Friday, January 27, 2012

Create a Firefox proxy through an SSH tunnel to Amazon EC2 instance

You can create an SSH tunnel to a server for Firefox in order to secure your web browsing - when on a public hotspot... or it can be used for other creative reasons for hiding your IP and routing your web traffic through another server :) that serves as a proxy.
I will use connection to Amazon EC2 instance as an example but it should work with any server to which you can log in remotely:

1. make sure that your server accepts SSH connections (port 22 incoming). If you're using the EC2 severs, this needs to be configured via their security groups (including the IP range for which the connection is allowed

2. connect to your server using this command (from Linux terminal (bash))   

ssh -i key.pem -D 9999 -C user@IP_or_server_name 

Replace the 'key.pem' with your private key file (if you need a private key for the connection), then replace user and IP... with your user credentials.

For Windows, use the PUTTY program. You will need to convert your private key file to a format that PUTTY supports- to do this, use the PUTTY gen utility.

3. verify that the connection is established

4. once verified, go to Firefox -> Edit -> Preferences -> Advanced -> Network -> Settings and enter the following preferences:
You should now be able to browse the web through the proxy in Firefox. Check your IP (try googling 'my ip'), the address should be the one of your server.





No comments:

Post a Comment