How to add socks proxy to ssh config file?

后端 未结 3 712
[愿得一人]
[愿得一人] 2021-01-31 13:27

I know how to forward SOCKS proxy on the command like below

ssh -D port_number user@host

This works well but I want to be able to put that forw

3条回答
  •  抹茶落季
    2021-01-31 14:21

    Use the config setting "DynamicForward" Here is a quick example of what it should look like:

    Host example.com
        User username
        Port 22
        IdentityFile ~/.ssh/id_rsa
        DynamicForward 8080
    

    If the DynamicForward option is only given a port numer it will bind to localhost:port. You can add a specific IP to get it to bind to an address other than the localhost. Using "*:8080" will bind the proxy to all IP addresses on the box. To use an IPv6 address enclose the address in square brackets:

    [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8080

提交回复
热议问题