From 4a96d4407660d7782500964131f45f0d86ade1ec Mon Sep 17 00:00:00 2001 From: Marco D'Agostini Date: Fri, 3 Jul 2020 20:24:03 -0500 Subject: [PATCH] New: Ssh server as a Tor hidden service --- Ssh server as a Tor hidden service.md | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Ssh server as a Tor hidden service.md diff --git a/Ssh server as a Tor hidden service.md b/Ssh server as a Tor hidden service.md new file mode 100644 index 0000000..d30e336 --- /dev/null +++ b/Ssh server as a Tor hidden service.md @@ -0,0 +1,57 @@ +*Shamelessly copied from https://www.techrepublic.com/article/how-to-run-an-ssh-connection-through-tor/* + +--- + +# Install Tor + +Install Tor on both client and server: + + sudo apt-get install tor -y + +# Configure Tor + +In the ssh's server let's edit tor's config file `/etc/tor/torrc`: + + sudo nano /etc/tor/torrc + +At the bottom of that file, add this: + + HiddenServiceDir /var/lib/tor/ssh/ + HiddenServicePort 22 + +Save and close file. + +Restart Tor: + + sudo systemctl restart tor + +And that's basically it!!! + +After restarting Tor, it will generate all the necessary files within `/var/lib/tor/ssh`, there you'll find the hostname (.onion address) you need to connect to the server. + +To find out that hostname: + + sudo cat /var/lib/tor/ssh/hostname + +You should get something like `riludi2kstjwmlzn.onion` + +# Connect to the Tor hidden ssh server + + torify ssh ... + +For example: + + torify ssh jack@riludi2kstjwmlzn.onion + +You can even make a config entry in `~/.ssh/config`, like this: + +``` +Host serverTor + User jack + HostName riludi2kstjwmlzn.onion + Port 22 +``` + +Now you can simply connect with: + + torify ssh serverTor \ No newline at end of file