Category: Database, firewall, shell

Short snippets: SSH Port Forwarding Scenario: Say you have a remote linux server somewhere remote (AWS EC2 or something) and you want to access a database whose port is blocked by a firewall, you can use the SSH (Secure Shell) local port forwarding command (-L) to gain access on your localhost to that port. This is very useful when you’re developing and don’t want to expose your database in the cloud to the outside world. Open a terminal and use this command below:(You may be prompted to enter the user’s password for the remote server) You can even specify another port if you wish, like this: Further Reading:If you want to find out more about SSH and tunnels, I recommend the two links below, there are much more things you can achieve with SSH tunneling.

Related Articles