#TIL : Create SSH tunnel manually

Sep 1, 2017 4 mins read 8d4302659

Create SSH tunnel manually

SSH Tunnel is a fast way to transfer traffic through unsafe internet today. It would be used in MySQL connect, FTP connect or HTTP connect, …

Syntax :

$ ssh -L [local_port]:[remote_endpoint]:[remote_port] [ssh_user]:[ssh_ip]

Example :

Lets say you have a EC2 instance ( and remote DB instance ( listening port 3306

$ ssh -L 3307: [email protected]

Testing ssh tunnel

$ telnet 3307
$ # or
$ mysql -h -P 3307 -u root -p
comments powered by Disqus