خرید بک لینک

I've a question about SSH reverse tuel. I've an ubuntu server with sshd installed. I open ssh reverse tuel from a remote machines, on that machine the coection is restarted every time the tuel is interrupted.

Whenever a tuel is opened, on the SSH server i can see two coection using netstat. One listening to the interal server port. Then other on an external port. The latter one is the SSH tuel.

As example. given 138.10.20.10: my ssh server and 10.34.23.12 my remote pc, 5000 the port on my remote pc i would like to access to

ssh -R 1122:localhost:5000 [email protected]

Now server side i've two listening coections, which looks like this

tcp6    0    :::1122              :::*                 LISTEN
tcp6    0    0 138.10.20.10:22    10.34.23.12:62734    ESTABLISHED

I the nc command from the server, to check for the tuel to work

nc -z -v -w5 127.0.0.1 122

Sometime it happens that the external coection dies, so my netstat will be

tcp6    0    0 138.10.20.10:22    10.34.23.12:62734    ESTABLISHED

Is there a way to check which tuel does not have an external port listening?

I mean, is there a way to check when my 1122 port dies? My solution would be kill the sshd process binded to the tuel without any external port (10.34.23.12:62734). The problem is that I've a other ssh tuel on this machine I would not like to kill, so killall sshd would not be an option.

Thank you!

برچسب: ssh reverse tuel,ssh reverse tuel multiple ports,ssh reverse tuel port forwarding,ssh reverse tuel coection refused,ssh reverse tuel background,ssh reverse tuel syntax,ssh reverse tuel putty,ssh reverse tuel not working, نویسنده: استخدام کار تاريخ: شنبه 6 شهريور 1395 ساعت: 20:38

صفحه بندی