Connect to a private network with an SSH Tunnel
If your database is on a private network, like inside a VPC and doesn't have a publically routable IP address for us to connect, you can setup a bastion host for us to connect through.
Step 1: Download our public key
Add our public key to your bastion host:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7Q9FkSSWx3IUNXiWZB5eq28/V1o24IbUnOZlpxGpG7jn3kY1j7ocJIDGIvtjWFv2MfyVtHRq7RG99tV3q7bo0KHCKe3VbLR5/NQfo9BYHoa1bg38lzYAwPOd4GT6chqy7M/7o5OCMawyec4RtaM9bYSPQxnpZi6vWST/vjjXsfGckUYGhUWIpVbaAUYCeuszq1EvvC3dVue1i8Fl5TYOK3tSLrYAM8aApyd2++qTOZht+0PoyP4JtT2MyuPSAP068Zyr0NskzbU/86ybMQVGTRI/y/7+K6gC0kr1f+Zy9LFMMKuq1wPx+FexTemXrgUwQO1IGqcdlpEid0f5Zb5EW6jIcBA5uftmo9RdcP5bYvRjPojvLlOOL+APMVwnpsMb+eSmORT0t0j8HeH/HKQdBLRDeexTBHXvCyMhG20DR4KEowmMV5ezLTMolxcBGJ03Tzixx2XuXCLve9ca/LjzqtAjT6AgmkOtIwVIiatyFuPkSjdl6jGYzjSTL2tWHUA3SU8LO49tpg66jLlRmQrwgZfv4dbhWavbuuaKgvoLMcB4QXJAhoIffCCWZh8koJb2ZLt7OvPh2+fpC4L+kh8WrtumpiIcfhwIY0lPrPfbM8pCZmrc4QANR4GybFOUHV6DKdXW90jCla1ljNRdwWSASm7XcLbSM7afC0ZjfIizHkQ== tunnel@silota.com
Step 2: Add a user to the bastion host
Create a user account "silota" to the bastion host for us to connect to. Make sure there's no password because we use public-key authentication.
ec2-user@bastion:~$ sudo useradd silota
Paste the above public key in the file /home/silota/.ssh/authorized_keys
as a new line.
Step 3: Connect via the private network option
Pick the "Connect to a private network" option and enter the bastion hostname, username ("silota" in this case) and the port for the SSH tunnel. These credentials are different from your database credentials.
Step 4: Test your connection
When you click the "TEST" button, Silota will create a SSH tunnel to your bastion host and try connecting to your database. All future connections to your database will be secured via the SSH tunnel.
![](http://www.silota.com/theme/images/figure-5.png)
No spam, ever! Unsubscribe any time. Learn more about the product.