How to setup SSH Tunnel on Mac OS X

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:
  • A Macbook Air
  • Internet connection

OK first, open Terminal and use the following command to connect to remote ssh server (CentOS)

ssh -ND 8888 root@


[root@dhani-centos-01 ~]# ssh -ND 8888 root@
The authenticity of host ‘ (’ 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.

Screen Shot 2016-02-11 at 6.50.27 PM.png Now select SOCKS Proxy and enter as the SOCKS Proxy Server and port : 8888 see the screenshot below.

Screen Shot 2016-02-11 at 6.52.41 PM.png

Press OK and now open to see your new IP address.

Screen Shot 2016-02-11 at 6.54.13 PM.png


Leave a Reply

Your email address will not be published. Required fields are marked *