Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an existing ssh tunnel which connects machine A to C over B.

#user@A: ssh -N user@B -L 9999:C:9999 

Is there any way to create a new ssh tunnel on D and attach it to the existing tunnel so that i can connect machine D to C? I tried to use

#user@D: ssh -N user@A -L 9999:C:9999 

but I get a no route to host error when trying to connect to C with

#user@D: telnet localhost 9999
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Providing you have already set up your tunnel on A to C via B, then

You want

#user@D: ssh -N user@A -L 9999:localhost:9999

#user@D: telnet localhost 9999
share|improve this answer

You are just creating another tunnel, it is not connecting to the existing tunnel. You probably want to connect to "localhost" on machine A instead (instead of C, which is already tunneled through B from A).

share|improve this answer
    
Ok, you mean by #user@D: ssh -N user@A -L 9999:A:9999? This just gives me a connection refused error. –  greole Mar 3 at 11:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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