keeping reverse ssh tunnel alive
- From: Ron Eggler <ronDOTeggler@xxxxxxxxxxxxxx>
- Date: Tue, 05 Jun 2012 11:02:12 -0700
Hi,
What's the best way to keep an ssh reverse tunnel alive?
Currently I call on my client (host that establishes the reverse tunnel)
this script every 10minutes:
#!/bin/sh
echo -ne "nameserver 8.8.8.8\nnameserver 8.8.4.4\n" > /etc/resolv.conf
RETVAL=`netstat | grep 'S0106b0487afe2a57'| grep -c 'ssh ESTABLISHED'`
echo "${RETVAL} open tunnel(s)"
if [ "$RETVAL" -lt "1" ]
then
echo "starting reverse ssh tunnel"
`ssh -R 19996:localhost:22 -f -N user@host`
echo "done"
fi
which checkes in netstat if the connection is still listed as established,
if not, reestablish it. But this doesn't seem to work very well. I just now
experienced that a client dropped off. Why is that? How can I improve this?
Thank you!
Ron
--- Posted via news://freenews.netfront.net/ - Complaints to news@xxxxxxxxxxxx ---
.
- Follow-Ups:
- Re: keeping reverse ssh tunnel alive
- From: Richard Kettlewell
- Re: keeping reverse ssh tunnel alive
- Prev by Date: Re: Where to mount partitions?
- Next by Date: Re: reverse ssh tunnel
- Previous by thread: Where to mount partitions?
- Next by thread: Re: keeping reverse ssh tunnel alive
- Index(es):