Automatically starting an encrypted tunnel

SSH TunnelThis shows you how to make a tunnel start automatically…

This article assumes that you have accomplished the steps at http://kaslnetwork.com/blog.php?id=84 and it for those using a Linux client (it can probably be done on Windows too with Putty, but this article doesn’t show you how to do that).

This is a very easy article, so I’m just going to give you the steps:

 

cd ~
touch .ssh_autostart
echo "#!/bin/bash" > .ssh_autostart
echo "sleep 10 && ssh -f -L 10000:your_virtual_host.com:80 user@myserver.com -N" >> .ssh_autostart
chmod +x .ssh_autostart

Now you need to make your computer automatically run the .ssh_autostart file when you log in. If you are using Gnome, then you would add the following line to a “New” entry in your gnome startup preferences:

gnome-session-properties
/home/your_username/.ssh_autostart

Now, after you log out and log back in, the tunnel should be automatically started.

Another thing I did to make this even better is I created a bookmark in my bookmarks toolbar which points to http://your_virtual_host:10000 – that way I never have to worry about forgetting to type the port.



Comments are closed.

Post Navigation