Yeah, I was making some big changes on my blog, and things kind of exploded in my face. My fault, it wasn't terribly critical so I nuked and reinstalled.
Just install Tor as you normally would, and turn on Hidden Services from port 22 to port 22 (for SSH). Keep track of the generated Tor onion hostname when you restart with Hidden Services enabled.
______________________________________
But here's the 'magic' part how to get .onion resolution across a Linux system:
get the following packages (Ubuntu, Debian)
sudo apt-get install tor iptables dnsmasq dnsutils
Add the following to the /etc/tor/torrc file
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
DNSPort 53
DNSListenAddress 127.0.0.2
Restart TOR
sudo service tor restart
Edit /etc/dnsmasq.conf and add the following:
listen-address=127.0.0.1
resolv-file=/etc/realresolv.conf
server=/onion/127.0.0.2
Make a new file, called /etc/realresolv.conf . Add this in the file:
nameserver 107.170.95.180 (or whatever nameserver you choose)
nameserver 8.8.8.8
Restart DNSmasq:
sudo service dnsmasq restart
Run the IPtables firewall update for redirection
sudo iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/10 -j REDIRECT --to-ports 9040
Also, this script must be run at every boot, so add this in /etc/rc.local, ABOVE the "exit 0"
/sbin/iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/10 -j REDIRECT --to-ports 9040
________________________________________________