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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -