***I do not endorse using this for anything that would break your company’s internet use policy.  This is for users with legitimate business needs and/or like having secure connections while using public internet(Starbucks, airport, hotels, etc.)***

Our office recently made some firewall/proxy modifications and I could no longer do a few things.  I couldn’t access my gmail via Outlook, couldn’t download torrents, and some other things I’, sure I could list if i wanted to take the time.  These may not seem work related, but I do use gmail to test applications and use uTorrent to download utilities I use here at work.  I had to find a fix.

I have a couple linux servers with ssh access and I can still get out via ssh, so I thought it was a good time to delve into learning about ssh tunnels.  It is incredibly easy.  This is for tunneling from a Windows client(although it is easy from linux, as well, I am not including in this post) to a server running the OpenBSD SSH daemon.  Here is a quick guide:

First, you’ll need to install ssh, this is most likely already installed on any linux box, so I won’t go too far into it.  If you are just now installing, I can at least say in Ubuntu, the command is:

sudo apt-get install openssh-server openssh-client

Nothing else really to it for starting out, although you may want to google some guides for securing/restricting access.

OK, so once ssh is installed, you will need to modify the configuration file (/etc/ssh/sshd_config).  You will need to change/add the following lines:

PermitRootLogin forced-commands-only

PermitTunnel yes

Alternately, you could use “PermitTunnel point-to-point”, but I think going with “yes” is more flexible for future modifications.  Alright, the server-side is done.  Simple enough, right.

Now, go ahead and download the putty ssh client.

Open up putty and type in the IP/hostname of your server, and select SSH.

putty1

Expand Connection>SSH on the left and select “Tunnels”

For Internet browsing and some other applications, normally a dynamic tunnel is best.  Type in a port that is normally unused(I used 7070, but most people advise using something above 10000) and select Dynamic then hit “Add”.

This is all you will need for internet browsing and torrents, but for now we’ll continue with outlook requirements.  Since Outlook does not allow proxy server configuration, you will have to simply forward your ports on your machine to the ports on the server you are connecting to.

Open up Outlook and goto Tools>Account Settings.

Select the account you want to go over the tunnel and hit change.

First, note your incoming and outgoing mail server names(mine are already changed to the final setting in the screenshot)outlook1

Then click “More Settings…” and go to the “Advanced” tab.

Now take down the incoming and outgoing server port numbers.

outlook2

OK, go back to your putty configurations and put the port number for incoming server in Source port and the incoming server name:port number in the destination.

putty2

Click Add.

Do the same for the outgoing server.

Once you have done this, go back to the “Session” section of putty on the left and hit Save.  Now, to connect your tunnel, hit Open.

To enable your applications to use the new tunnels, we will need to make a couple more small changes.

FIREFOX:

Goto: Tools>Options

Click the Advanced tab, and the Network tab within that.

ff1

Select Settings…

Choose Manual proxy configuration:

Fill in SOCKS Host: line with localhost, and the Port to whichever port you chose for the dynamic port in the tunnel(mine was 7070).  Select SOCKS v5 and hit OK.

ff2

Now, your Firefox will browse via your home internet connection.

INTERNET EXPLORER

almost identical to Firefox configuration.

Goto Tools>Internet Options

Click the Connections Tab, then click LAN Settings

Fill in the proxy data:

ie

(My layout may look different, I am using IE 9 beta, but they all have the same options with a slightly different look)

UTORRENT

Goto Options>Preferences

Select Connection.

Under Proxy server, change the Type to Socks5 and put 127.0.0.1 in the Proxy: line and the port into the port line.

Make sure to check “Use proxy server for peer-to-peer connections”.

Click OK.

ut

OUTLOOK

OK, the one I’m sure most of you are the most interested in, Outlook.

All we have to do here is go back to the account settings where you viewed your incoming/outgoing server before, and change the server name to “localhost”(without the quotes).

You should be all set.  The only thing to note is, these applications will only work with those settings when your tunnel is connected.  If you close putty or are back at home and don’t need the tunnel, just uncheck to use proxy and everything(except outlook) will save your settings and work, where you only have to go back and say use proxy and it will use the tunnel you created before.  For Outlook, you would have to put the incoming/outgoing servers back in.

Let me know if you have questions about other apps, ideas for improvement, or any problems.

Be Sociable, Share!

« »