Thursday, February 20, 2014

Tunnel To a Server With A LAN only IP From a Server with Public Internet IP

Tunnel To a Server With A LAN only IP From a Server with Public Internet IP

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

http://ubuntuguide.org/wiki/Using_SSH_to_Port_Forward

Using Windows Desktop? You may use putty to tunnel to server A for step 1.

https://code.google.com/p/putty-tunnel-manager/

Post a Comment

Today Notes Blog About Linux Open Source Computer Internet

comments powered by Disqus

Popular Posts