I have two servers. For example1.com and example2.com
At example1.com server I have my php code and example2.com there is a postgreSQL database.
Now I want to connect postgreSQL through a tunnel in example1.com
I tried the following command at example1.com server.
ssh -L 5433:localhost:5432 [email protected]
Then it will prompt for password and I enter the password and login to ssh, then I am trying to connect to database localhost:5433 post but I am getting 'password authentication failed'.
How do I connect to example1.com through ssh?