There is client infrastructure containing two servers - server1 (files), server2 (database - postgreSQL). We have direct access to the server1 (ftp/ssh). Server2 is not accessible directly, only from server1 and only for database connections (so no ftp/ssh access). Is there some solution, how to connect pgadmin from localhost to server2 in this configuration (by using that intermediate server1)? We are using this tool because it is desktop tool and has some advantages to phppgadmin (no memory limit, ...).

Classic ssh tunnel works only to server1, but I cannot connect it to server2 thru server1. Maybe some configuration, or script would be needed on server1?

Thanks for your help


It's unclear waht "ssh tunnel works only to server1" means, but this should work:

ssh -L 5432:server2:5432 user@server1 

It would forward the local port 5432 to server2:5432 tunneled via server1.

You would then point pgadmin to localhost:5432.

If this doesn't work, please edit your question to contain more information. Error messages, log file entries, relevant configurations etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.