A temporary secure proxy using Amazon EC2 and ssh
Have you ever found yourself in a coffee shop using their network while wondering who was watching your traffic? I know that I do.
So with that in mind and access to an Amazon account, I decided to see how hard it is to setup squid on an Amazon instance, open a ssh tunnel from my laptop to squid, and configure Firefox to use the tunnel/proxy. As it turns out it was very easy and now I have an AMI (Amazon Machine Image) that I can fire up when I find myself working in a coffee shop.
Setting up was easy. I started up my base gentoo instance, logged in, and installed squid.
emerge squid
I did not need to do anything to the configuration, so I just started squid
/etc/init.d/squid start
Then I created the ssh tunnel
ssh -i ec2-keypair -f -N -L3128:localhost:3128 root@hostname
Then all I had to do was set my Firefox Proxy settings to “localhost” port “3128″. Once I was done all I had to do was shut down tho ssh tunnel and turn off proxy in Firefox.
My next steps will be to write a script to start up the instance and the tunnel. Not too shabby, and secure enough to foil most any snooping coffee shop individual.