New: Ssh server as a Tor hidden service
This commit is contained in:
parent
cbd6729c17
commit
4a96d44076
57
Ssh server as a Tor hidden service.md
Normal file
57
Ssh server as a Tor hidden service.md
Normal file
|
@ -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
|
Loading…
Reference in New Issue
Block a user