SSH tunnel basically does the port forwarding via secure ssh service.
Let’s start with launching a latest hardened AMP stack AMI (ami-e0b05389) instance.
Once the instnace is up and running, open the terminal client and connect to the instance using ssh.
Edit the /etc/ssh/sshd_config file and set AllowTcpForwarding to yes
Restart ssh service
svcadm restart svc:/network/ssh:default
Comment out skip-networking from /etc/mysql/my.cnf and save the file
Restart MySQL service
svcadm restart svc:/application/database/mysql:version_51
exit the ssh connection and recreate ssh connection using following command.
ssh -i <keypair> -L 3307:localhost:3306 email@example.com
Keep the terminal opened, and start MySQL Query Browser / MySQL administrator from your local machine. and connect to the MySQL server on remote EC2 instance via the port 3307, as shown in the following sanpshots.
When done close the ssh connection and it should close the ssh tunnel.