Last active
February 8, 2019 23:11
-
-
Save dasgoll/8a360818dfe78fc286d773ee5cfdd654 to your computer and use it in GitHub Desktop.
access ssh hidden service via tor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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