LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem in remote ssh port using Port Forwarding (http://www.linuxquestions.org/questions/linux-server-73/problem-in-remote-ssh-port-using-port-forwarding-4175429216/)

arun5002 09-27-2012 12:36 AM

Problem in remote ssh port using Port Forwarding
 
Hi

These the scenerio im trying to work out


Office network
51.26.12.xx(static) -Nated -10.200.2.1(localofficenetwork)

home network
192.168.1.1(home)



Quote:

ssh -L 9580:10.200.2.1:22 root@51.26.12.xx


#netstat -tunelp | grep 9580
tcp 0 0 127.0.0.1:9580 0.0.0.0:* LISTEN 9580 61679 12768/ssh

Now i could find the remote local network 10.200.2.1(port 22) is listening to loop back interface on
port 9580 on my home pc.I try to login into local nated machine using ipaddress 10.200.2.1


But never seems to connect the remote local office machine.Any help ,whether i can achieve the remote office lan network using these scenerio

#ssh root@localhost -p 9580

evo2 09-27-2012 01:02 AM

Hi,

sorry I don't know the answer to your question, but I can suggest an easier way to to to the 10.100.2.1 machine from your home. On your home machine add the following to your .ssh/config
Code:

Host 10.200.2.1
    ProxyCommand ssh -qax -W %h:%p 51.26.12.xx

Now you should be able to just ssh to 10.200.2.1 "directly" from your home machine.

HTH,

Evo2.

PS. If your ssh is too old to accept the -W, you can do a trick with netcat instead.


All times are GMT -5. The time now is 04:11 PM.