Ssh – built-in way to proxy SSH through socks5

netcatnmapsocksssh

I have a Socks5 proxy that uses username/password authentication. I can use it with SSH using NCAT in the ProxyCommand: ssh -o ProxyCommand="ncat --proxy-type socks5 --proxy-auth username:password --proxy socks5.proxy.domain:1080 %h %p" root@ssh.server.domain

I'm using ncat from the NMAP package because the built-in nc command doesn't handle Socks5 proxy authentication.

Is there a simpler way of doing this without requiring nmap to be installed on the client?

Best Answer

There's no built-in support for SOCKS5 proxy since ProxyCommand is generic enough that it provides support for any kind of proxy.

However nc does support SOCKS5 using -X 5 so there's no need for ncat.