Jump to content


- - - - -

Using a Ubuntu/Debian VPS to Establish Anonymous SSH sessions with TOR


  • Please log in to reply
No replies to this topic

#1 Pirate Tony

Pirate Tony

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts

Posted 12 June 2016 - 04:10 PM

Perhaps you’ve wanted to set up a virtual private server (VPS) to anonymize HTTP traffic on the TOR network.

OpenSSH would be the first solution that admins would turn to, given the fact that OpenSSH is the de facto tool used utilize to encrypt connections on a VPS.

A bigger question remains: How do you port all of your TOR connections through SSH? A few configuration changes must be made. Also, a proxy must be established in order to achieve an anonymous SSH session with TOR.

Luckily, all of this is really easy to configure.

In case you haven’t installed TOR yet, you may want to go ahead and do so. The instructions for installing TOR has been published numerous times online. Here is a recap of how to get TOR installed:

Refresher on Installing TOR

If TOR isn’t available in your repository, you must take steps in order to ensure that it is available for you to install.

If you can confirm that TOR is already available for you to install, you may skip to the section and proceed to the section titled, “One Liner for Updating Repos and Installing TOR.”

If TOR Isn’t Available in your Repository

You would want to open /etc/apt/sources.list and add the following line.
 

    deb http://deb.torproject.org/torproject.org DISTRONAME main

Note: the DISTRONAME in caps needs to be replaced with your distribution’s name. For example, Lenny, Squeeze, etc.

Install the PGP Key

Experts recommend that you install a PGP key to ensure that the repo is authorized. In a terminal session, type:
 

    apt-key adv –recv-keys –keyserver subkeys.pgp.net 0x94C09C7F

Next, you are ready to update your repositories and get TOR installed.

One Liner for Updating Repos and Installing TOR
 

    apt-get update && apt-get install -y tor

You must now install the proxy we discussed above, which can be done using the following command at the terminal:
 

    apt-get install -y connect-proxy

But Wait, There’s More: Configuring OpenSSH to Work with TOR

At this point in the tutorial, you have everything in place. Now it is time to make OpenSSH and TOR work seamlessly.

Most experts do not recommend setting up OpenSSH to use TOR for all connections. If you wish to do so, you’d open your ~/.ssh/config file and add this to the top of the file:

   

Host *
    CheckHostIP no
    Compression yes
    Protocol 2
    ProxyCommand connect -4 -S localhost:9050 $(tor-resolve %h localhost:9050) %p

 

Most of those who set up their VPS to create anonymous SSH session with TOR will only want specific connection types to be tunneled in this fashion. To define specific connections, you’d open your ~/.ssh/config file and add this text to the top of the file:

  

  Host YOURDOMAINNAME
    HostName YOURDOMAINNAME.COM
    User YOURACCOUNT
    CheckHostIP no
    Compression yes
    Protocol 2
    ProxyCommand connect -4 -S localhost:9050 $(tor-resolve %h localhost:9050) %p

 


Note: In the above text, you’ll want to change YOURDOMAINNAME and YOURACCOUNT to match the appropriate values for your environment.

Conclusion

That’s the general gist of setting up a VPS to create an anonymous SSH session with TOR.

When you set up this type of service, we remind you to only do so within the laws and legal regulatory framework in your area. You should only use a VPS to create anonymous SSH tunnels with TOR to conduct lawful activities.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users