Sunday 14 July 2019

Using TOR to provide remote access to anywhere


One of TOR's most useful features for the sysop/sysadmin is it's ability to forward not just web traffic but any TCP port.


For example, to open up SSH on a TOR router (note that the TOR router does not even need an IP address, just some kind of connection to the internet. Also note that this will PUBLICALLY OPEN SSH TO ANYONE ON THE TOR NETWORK - you have been warned...) just add the following HiddenService declaration to your torrc file:
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 22 127.0.0.1:22

Look in hidden_service/hostname for the (autogenerated) name of your TOR server. Give the TOR network a few minutes to propogate your new server address, then you should be able to connect to your TOR router from anywhere in the world by issuing:
torify ssh user@yourhostname.onion
Or using torsocks instead.

3 comments:

  1. I want to set up email for my onion address - how I do this with what you say here?

    Thanks You, Wouter.

    ReplyDelete
  2. Hi Wouter,

    Email is a bit of a funny one with TOR. Normally email addresses rely on a DNS lookup of MX records to decide where to deliver the mail. In the absence of DNS, we would need the MTA (Mail Transfer Agent) of all SMTP servers in our HiddenService instances to be torified or to run through the SOCKS proxy to find where to go to connect to port 25 on somethingdomain.onion to deliver the mail we're sending to user@somethingdomain.onion.

    This is do-able, it's not neat and it's kludged, but it can be done. However because of the way the proxy works, port 25 on somethingdomain.onion is left as an open relay for anyone and everyone to spam through. In an ideal world without the processed canned meat we could leave all our mail servers as open relays, kinda like an electronic bothy.....

    Hope this helps

    ReplyDelete
  3. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. сайт гидры

    ReplyDelete