0

I would like to connect to postgresql server which is not a public IP.
I need to do port forwarding to access the server. I used SSH client putty to do port forwarding.
I keyed in 6666 under "source" field of Putty and 172.13.212.37:5432 under "destination" field of putty. Later, I launched pgadmin and keyed in 127.0.0.1 under hostname/ipaddress and 6666 under port, but still am not able to connect.
Instead I get Fatal password authentication failed error. I am 100% sure that my password is right. Am I making any error in port forwarding?

Scenarios tried

enter image description here

1enter image description here

The Great
  • 149

1 Answers1

1

Am I making any error in port forwarding?

Probably, yes. The "destination" field in the tunnel declared in Putty must be the IP address and port of PostgreSQL from the point of view of the server you ssh into.

You mention it has no public IP, but 172.13.212.37 is a public IP address (see https://www.whois.com/whois/172.13.212.37).

In your case, it's a private IP address that is expected be in the "destination" field. If PostgreSQL is running on the same server than the one you ssh into, that would be 127.0.0.1 or localhost , otherwise a private network address if the PostgreSQL server is reachable through the local network.