SSH – How to Connect Through a Proxy on CentOS 7

centoscentos-7PROXYssh

I am trying to connect to a SSH server through a proxy on Centos 7.

I found some solutions with ProxyCommand and connect-proxy but this one is not available for Centos 7.

I found another way with nc (nmap-ncat) and the -X option but the one installed on Centos 7 returns an error nc: invalid option -- 'X'.

How can I connect to a SSH server through a proxy with Centos 7 ?

Best Answer

I just have encountered this problem on a Centos 7 myself. In order to connect I installed proxy-connect that is available on the epel repos.

Then, once installed, is was just a matter of finding the proper options for my case, a SOCKS5 proxy:

ssh -o ProxyCommand="connect-proxy -S proxy_ip:proxy_port %h %p" remote_user@remote_server_ip

Hope this helps.

Related Question