![]() |
Feel free with Open Source SoftwareAndries Filmer - Internet professional sinds 1996.
|
|
|
|
SSH over TorIntroductionSometimes we want a anonymous ssh connection and ssh is good for a secure network traffic but ssh does not hide your ipnr from whom it connects. Tor provides just such a capability.
Install torThe anonymizing overlay network for TCP tool.
apt-get install tor
Install connect-proxyWe need connect-proxy to establish a TCP connection using SOCKS4/5 or HTTP tunnel
sudo apt-get install connect-proxy
Running SSH through TorTo run SSH over Tor, run the following command. Substitute your username for andries and the IP address you wish to connect for 1.2.3.4 .
ssh -l andries@1.2.3.4 -o ProxyCommand="/usr/bin/connect -4 -S localhost:9050 %h %p" "-o" passes the following argument as option in the format used in the configuration file. In this case, it passes the option ProxyCommand with the value of "/usr/bin/connect -4 -S localhost:9050 %h %p". Port 9050 is the default portnumber for tor. Additional options for ssh are covered in its man page. The "-4" option tells connect to use SOCKS protocol 4. The "-S" option specifies the hostname and port number of the SOCKS server to relay. Do not pass a hostname instead of an IP address as the remote machine to which you wish to connect. If you pass a hostname, ssh uses your name server to resolve the name before passing it to connect. This deprives you of the protection of Tor for your name resolution. Instead use the program tor-resolve which is included with the Tor distribution. tor-resolve takes two arguments, the first is a fully qualified domain name (FDQN), the second is SOCKS proxy connection. The example below resolves www.google.com over the SOCKS proxy running on localhost over 9050 using Tor.
tor-resolve www.google.com localhost:9050 64.233.161.99 Resource: https://www.antagonism.org/anon/ssh-tor.shtml
I appreciate if you give some comment about this page. Please go ahead. |
|
Andries Filmer | http://andries.filmer.nl | andries@filmer.nl | © 2011
|