SSH Tunnelling provides a secure way to access your local network from a public internet connection. For example, you may use an internet cafe to connect to your remote network safely without having to worry about being spied by hacker or any unwanted people. This short tutorial will show you how to setup a SSH Tunneling on Mac OS X.
What I use:
- A remote computer with public IP. I am using my CentOS 7 running on DigitalOcean cloud with IP address: 22.214.171.124
- A Macbook Air
- Internet connection
OK first, open Terminal and use the following command to connect to remote ssh server (CentOS)
ssh -ND 8888 firstname.lastname@example.org
[root@dhani-centos-01 ~]# ssh -ND 8888 email@example.com
The authenticity of host ‘126.96.36.199 (188.8.131.52)’ can’t be established.
ECDSA key fingerprint is 4d:47:45:bd:15:0a:78:da:96:a7:eb:98:0f:4b:05:25.
Are you sure you want to continue connecting (yes/no)?
Type yes to confirm the connection. You will be asked for password for root user to login to remote computer. At this point, the ssh tunnelling is done. Now, we can browse anonymously using web browser such as Google Chrome.
Open Google Chrome and go to Setttings | Show Advanced Settings. On the network section, click Change proxy settings.
Now select SOCKS Proxy and enter 127.0.0.1 as the SOCKS Proxy Server and port : 8888 see the screenshot below.
Press OK and now open whatismyip.com to see your new IP address.