Connecting to host by SSH client in Linux by proxy [closed] Connecting to host by SSH client in Linux by proxy [closed] linux linux

Connecting to host by SSH client in Linux by proxy [closed]


Check the docs for the ssh ProxyCommand option. You can specify a command to run (for example, nc) to connect to a given host and port. For example, adding this to your .ssh/config might work to traverse a SOCKS5 proxy:

ProxyCommand nc -x MY_PROXY_HOST:MY_PROXY_PORT %h %p

More detailed instructions are going to depend on your environment.


There are several ways to do it. You can use nc or try wrappers like corkscrew. I'll describe way with wrapeer:

Firstly install corkscrew by apt-get
Then you need to specify ProxyCommand in your ./ssh/config file (replace example-proxy.com and 8080 with your proxy host and port):

Host *  ProxyCommand corkscrew example-proxy.com 8080 %h %p ~/.ssh/proxyauth

Your login credentials should be in ~/.ssh/proxyauth in format:

login:password