You are not logged in.

#1 2011-10-26 17:03:09

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Two question regarding SSH tunnels

... which are:

1. Suppose I have an ssh tunnel (master connection) localhost->host1 via socket in /tmp. Then in a separate shell:do

ssh -NL 9999:host2:22 host1

which maps localhost:9999 to host2:22 via host1. This will go through the above tunnel. If I now kill ssh -NL with Ctrl-C, in netstat I still see port 9999 in LISTEN:

State      Recv-Q Send-Q                             Local Address:Port                                 Peer Address:Port   
LISTEN     0      128                         localhost.localdomain:9999                                           *:*        users:(("ssh",1724,43))
LISTEN     0      128                         localhost.localdomain:ipp                                             *:*       
LISTEN     0      100                         localhost.localdomain:smtp                                            *:*  

Why is that and how do I get rid of it without closing the tunnel?

2. In addition to tunnel in (1), let me establish a master connection host1->host2, so now there are two tunnels: localhost->host1 and host1->host2. Is there a way to connect to the 2nd through the 1st? I tried simply ssh -L trick as before, but this creates a separate connection to host2, while I want only 1 connection (there are connection limits and I am not admin).

Thanks.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB