Looking for Good Web Hosting

Search This Blog

Thursday, February 26, 2015

SSH over TOR on OSX (Yosemite, Mavericks, Mountain Lion, Lion, Snow Leopard)

After a lot of search and try, finally I could manage to connect through TOR on my server via SSH, most the search result points to the same command, which is incomplete for Mac OSX, here is how you can connect to any ssh server over tor:

ssh -o ProxyCommand='nc -X4 -x 0:9150 %h %p' user@host

with -X (caps) you specify to netcat the proxy version you are using, in this case SOCKS4.
Taken from the man page:

-X proxy_version
             Requests that nc should use the specified protocol when talking to the proxy server.  Supported protocols are ``4'' (SOCKS v.4), ``5'' (SOCKS v.5) and ``connect'' (HTTPS proxy).  If the protocol is not specified, SOCKS version 5 is used.

So, if you were trying using netcat with the 'connect' argument for -X it will not work because that TOR port is SOCKS4 and not HTTP proxy.

I hope you find this info useful.

PD: I used 0 on hostname parameter because its the same as 127.0.0.1, or localhost.

No comments: