Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Last active February 8, 2019 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasgoll/8a360818dfe78fc286d773ee5cfdd654 to your computer and use it in GitHub Desktop.
Save dasgoll/8a360818dfe78fc286d773ee5cfdd654 to your computer and use it in GitHub Desktop.
access ssh hidden service via tor
### on server
apt-get update
apt-get install vim tor -y
vim /etc/tor/torrc
HiddenServiceDir /var/lib/tor/ssh_hidden_service/
HiddenServicePort 22 127.0.0.1:22
systemctl restart tor
### on client
apt-get update
apt-get install tor openssh-client netcat-openbsd -y
# inside 16.04 container
#/etc/init.d/tor start
systemctl start tor
vim ~/.ssh/config
Host *.onion
ProxyCommand /bin/nc -xlocalhost:9050 -X5 %h %p
ssh -l goll hltq2qepgxoh7fuy.onion
## to provide password at command line or even use ansible
apt install sshpass
sshpass -p yourUglyPassword ssh npv
### optional
if on server
#HiddenServiceAuthorizeClient stealth goll
on client
HidServAuth hltq2qepgxoh7fuy.onion gMBPnUPMSB/2QHtaQgJ1mB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment