Using SSH tunneling on a Mac to change your geographic location

Recently while traveling abroad, I noticed some of my favorite streaming services are not available outside the United States. There are many VPN services available that route your traffic through servers in other countries, but if you have an AWS account or access to an SSH enabled server in your desired country, you might be able to set up an SSH tunnel in seconds, without the need for a VPN service.

Step 1: Launch your instance.

On AWS you can select the region you'd like to tunnel your web traffic through, then launch an EC2 instance in that region.

Step 2: Create an SSH tunnel

ssh -D 8080 -C -N -i "<your-pem-file>.pem" ec2-user@<your-ec2-instance-id>.compute-1.amazonaws.com

Step 3: Configure a SOCKS Proxy in network settings.

System Preferences > Network > Advanced > Proxies > SOCKS Proxy > 127.0.0.1:8080

Screen-Shot-2018-04-30-at-12.23.41-PM

You are now routing all network traffic through your remote server. Some streaming services drop a cookie when they detect you are in a restricted geographic location, so it may be necessary to clear the site's cached data.
Don't forget to turn off the proxy in System Preferences after your tunnel has been closed or else your internet connection wont work. Also don't forget to terminate your EC2 instance once you're done!

Show Comments