I constantly got this in windows (VM).
So, I decided that the pgAdmin built in the ssh tunnel was not good and just used gSTM (On linux).
Migrating a port from a remote server 5432 to a local host 5555. Then I could just use pgAdmin III for Linux.
You can probably use the command line if you do not want to use a graphical tool like gSTM. ssh -fNg -L 5555: localhost: 5432 {your_username} @ {yourdomain.com}
Source: http://dustindavis.me/ssh-tunnel-in-pgadmin3-for-postgresql/
You can also use putty for windows to forward ports. See Connection | Ssh | Tunnel menu in PuTTY configuration.
http://www.akadia.com/services/ssh_putty.html
Then you can access it.
Of course, be very careful in the remote database. It is a good idea to label them red or orange in pgAdmin to easily identify those that are not on your local network.
Liam Mitchell
source share