Create SSH user just for HTTP Tunnel using private key authentification

You may find the need to tunnel your internet traffic encrypted through a server that you own and trust. You can do this with a VPN but their IP addresses are often blacklisted and are also particularly slow.

You may choose to do this for security, you may want to hide your torrent traffic from your ISP, you may want to appear to have a different IP address, perhaps to watch your UK TV while abroad maybe?

If you have access to a VPS or dedicated server, even a standard PC running linux connected to the internet with a fast internet connection then here’s what you can do!

First of all let’s create the tunnel user and restrict them to rbash only

useradd tunneluser1 -m -d /home/tunneluser1 -s /bin/rbash
passwd tunneluser1

If you don’t use private / public keys then you’re all good to go with standard password based logon.

Follow the guide for using putty as a local HTTP(S) proxy and you’re all set!

If you want to use private / public keys then login as that user via shell and create the .ssh directory.

mkdir .ssh
chmod 700 /home/tunneluser1/.ssh

Now we need to create the authorized_keys file and paste the key information inside

vi /home/tunneluser1/.ssh/authorized_keys

Paste your key and save the file, then set the permission to 600

chmod 600 /home/tunneluser1/.ssh/authorized_keys

Finished, now follow the guide for using putty as a local HTTP(S) proxy and you’re all set!
Here is the guide for creating private / public keypairs using putty / puttygen

Print Friendly, PDF & Email

More Like This


Security Security


  • Post a comment