Tag Archives: ssh

Amazon RDS Tunnel (Access from your desktop)

If you need to access an Amazon RDS instance locally you can:

  1. Add your IP on the RDS Security Group
  2. Create a tunnel to the RDS

Best chances are you have a dynamic IP address, so you already know that option 1. is a real pain.

You can create a tunnel (2.) by performing the following command on a new terminal window:

ssh -l <username> -L 33060:<ec2_rfc_ip>:3306 -N <ext_hostname>

As long as you keep this window open, you’ll be able to access the RDS by connecting to localhost on port 33060:

SSH connection keeps dropping

I’ve got a shitty internet connection at the moment. While I’m surfing I can barely notice, but the connection itself keeps dropping. As a result, all my SSH connections drop as well.

Here’s the little trick I’me using:

ssh -o ServerAliveInterval=30 user@host.com

This will force a “I’m alive” signal every 30 seconds – it is enough to keep me connected!

Additionally, if you want ALL ssh connections to have this option you can edit the ~/.ssh/config file:

Host *
ServerAliveInterval 30