I'm assuming you know OpenSSH and terminal commands.
We have a server called Server A thats can be remote SSH from public Internet. We have a Server B, with LAN only IP with same segment as Server A. Server B can only can be access from Server A. With Only port SSH open for both servers. SSH port monitored by using fail2ban.
We want to access a Postgresql Database in Server B by using of PgAdmin and I'm using Ubuntu desktop. From command line terminal by using this command, I'm accessing Server A.
Step 1 :-
ssh -L 35432:localhost:35432 [email protected]
Step 2 :-
Successfully access server A, I will SSH to Server B with this command.
ssh -L 35432:localhost:5432 [email protected]
Step 3 :-
And then using Pgadmin to access localhost port 35432 to access the Postgresql Server B.
For more info
Using Windows Desktop? You may use putty to tunnel to server A for step 1.