Tag Archives: proxy

How to ssh from Mac via socks proxy

In order to ssh from Mac via socks proxy you will need to use ncat utility.


You will need to use ncat utility which is not available on OSx by default, and is not directly in homebrew, but you can get it by installing nmap (as nmap installation includes ncat utility with support of socks5)

Install nmap

brew install nmap

Connect to your target host

ssh -v -o 'ProxyCommand=ncat --proxy-type socks5 --proxy proxyhost:proxyport --proxy-auth proxyuser:proxypass %h %p' -p22 username@serverhost

That’s is, the only disadvantage is that you need to fill in your user:pass in the command itself. If you have any idea how to overcome it please let me know.

Reference https://stackoverflow.com/questions/34348720/osx-ssh-to-server-through-socks5-proxy