May 7, 2010

SSH Tunnel

Hi,

In previous post i explain about ssh without password. hope you tried.

This time i am showing some trick, from that you can make ssh tunnel and easily make connect to your office server from home without knowing public IP.

Scenario : Your company block access to port 22 ( i.e ssh port) and you do not know public IP or Your Server is not mapped to Public IP. You can want to work from home with ssh service.

Solution : You need to generate you customize port on your home pc from office server which you want to connect. for that you need two important things. First Internet on both end and static IP to your home PC. Finally following steps.

For consideration, Home IP is 177.177.177.177

Steps :
First on server side

1. login to server as root or super privilege
2. run following commands
# ssh -R 988:localhost:22 root@177.177.177.177

-R will generate port 988 on localhost of home pc (i.e 177.177.177.177)

After getting terminal, login on your pc and leave this terminal open.


Now Come to home pc

1. login to home server as root
2. run following command
# ssh -p 988 localhost

-p will connect to port 988 on localhost.

This will help to connect back to office server. Because ssh thinks, he is connecting to localhost on port 988 and port 988 will lead to your office server without asking IP and router mapping.

1 comment:

Anonymous said...

Its Awesome!!! I tired and its works.

thank you