LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tunnel ssh over ssh (https://www.linuxquestions.org/questions/linux-newbie-8/tunnel-ssh-over-ssh-4175424064/)

spiky0011 08-26-2012 10:46 AM

tunnel ssh over ssh
 
Hi

I would like to connect via ssh to a 3rd lappy. Home network.
I have a laptop with ssh client which can connect to ubuntu server firewalled then to 3rd laptop with ssh server installed no firewall, ssh port is 1960 on server machines.
I can ssh into server ok and into laptop3 ok I have been trying to go through server then to laptop.
Need to set up forwarding port not sure how to,
I have the server firewall to allow all on local network.

laptop/ssh-client>>>>>server-ssh-FW>>>>>>>laptop3-ssh-server+client

iamwilliam 08-26-2012 11:50 AM

Set up the ssh tunnel as follows
Code:

ssh -p 1960 -fNL 8022:laptop3:22 server-user@server-fw
Connect through the tunnels as follows
Code:

ssh -p 8022 laptop-user@localhost
Hope this helps.

spiky0011 08-26-2012 01:18 PM

Hi

Still a problem when I run
Code:

ssh -p 8022 spiky@laptop3:22 (I pressume 22 is port for ssh)
I get

"ssh: connect to host 10.42.43.11 port 8022: Connection refused" (10.42.43.11) is 1st laptop.

If I run the 1st command again
Code:

ssh -p 1960 -fNL 8022:laptop3:22 server-user@server-fw
I get

"bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 8022
Could not request local forwarding."

Fixed by changing port number to correct 1

spiky0011 08-26-2012 02:06 PM

Ok I thought this was solved but it appears not. If I stop ssh on the server I can still connect to the other laptop using
Code:

ssh -p 8022 laptop-user@localhost
Any other ideas plz

The idea was so if I was outside local network I could ssh into server then to other machines on network


All times are GMT -5. The time now is 09:31 PM.