Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
This is fine.
habrahabr.ru/post/81607 :
It's no secret that the connection sometimes breaks, the tunnels will fall off by timeout.
In order not to bother ourselves with the additional monotonous driving in of a command to raise the tunnel and monitoring this process, we automate it. Feel free to enter:
$ crontab -e
and create a schedule like this:
TUNCMD1='ssh -f -N -R 2222:10.11.12.13:22 [email protected]'
TUNCMD2='ssh -f -N -R 2080:10.11 .12.14:80 [email protected]'
*/5 * * * * pgrep -f "$TUNCMD1" &>/dev/null || $TUNCMD1
*/5 * * * * pgrep -f "$TUNCMD2" &>/dev/null || $TUNCMD2
I solved the problem of breaking connections by timeout in SSH by setting
ServerAliveInterval 60 in the
/etc/ssh/ssh_config
file on the client machine
At work I have SSHD on the server and a working machine under Windows. Sometimes I need to go from home to work via RDP, and sometimes from work home via RDP.
First, a couple of handy aliases:
alias ssh='ssh -o TCPKeepAlive=no -o ServerAliveInterval=15 -o ServerAliveCountMax=10'
alias mars='ssh [email protected]_IP'
autossh is here to help. The syntax is the same as ssh.
ServerAliveInterval should not be included, by the way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question