How would I go about connecting to a database that can only be accessed through an ssh tunnel to an ec2 instance. The current route would be:
My ubuntu laptop -> ec2 instance -> postgres database server
I have been accessing the database using the terminal but would prefer to be lazy and use something like pgAdmin or RazorSQL. I am assuming I can do an ssh tunnel to my ec2 instance, then some sort of port forward to the database server but I haven’t been able to get beyond the ssh tunnel.
A double hop ssh tunnel will not work because I don’t have ssh access to the DB server.
Thanks!
You want to do something like this - where ec2-dbserver is your database server (inside EC2), and ec2-host is the host that you can ssh2.
You should then be able to point pgadmin-III to localhost:5432
ssh -L 5432:ec2-dbserver:5432 user@ec2-host