ssh tunnel - What is the best way to connect to a remote database server that can only be accessed from a different ec2 instance? -
how go connecting database can accessed through ssh tunnel ec2 instance. current route be:
my ubuntu laptop -> ec2 instance -> postgres database server
- i have complete control on ec2 instance.
- i have access port 5432 of remote database server via ec2 instance. lives on different server.
i have been accessing database using terminal prefer lazy , use pgadmin or razorsql. assuming can ssh tunnel ec2 instance, sort of port forward database server haven’t been able beyond ssh tunnel.
a double hop ssh tunnel not work because don’t have ssh access db server.
thanks!
you want - ec2-dbserver database server (inside ec2), , ec2-host host can ssh2.
you should able point pgadmin-iii localhost:5432
ssh -l 5432:ec2-dbserver:5432 user@ec2-host
Comments
Post a Comment