ssh through Tor on macOS

Time ago I posted about how to ssh throug tor and torsocks, bypassing Apple SIP in a very lame way.

Today I found a more elegant way to escape this limitation and still ssh through Tor via Netcat.

Homebrew’s netcat provides version 0.7.1, which doesn’t support proxy so it’s not suitable for our purpose. We will install Nmap’s improved version ncat

brew install nmap tor

This will install both Nmap and Tor. Now, very easily, let’s proxy ssh through Tor by using ProxyCommand:

ssh -o ProxyCommand="ncat --proxy-type socks5 --proxy 127.0.0.1:9050 %h %p" root@dest-host

That’s it!

You can create a convenient shell alias by adding to your ~/.zsh (or ~/.bashrc):

alias torssh='ssh -o ProxyCommand="ncat --proxy-type socks5 --proxy 127.0.0.1:9050 %h %p"

Un pensiero su “ssh through Tor on macOS

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Solve : *
29 − 8 =


Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.