Nearing the End
bash/ssh TimeoutHow to ssh to a machine where I run bash and not have the session timeout after an hour of inactivity???!? Just Unset TMOUT? Nope, it wasn't set and I Still Timeout.$ ssh ud00 Last login: Wed Aug 2 13:43:47 2006 from dsl027-167-091.atl1.dsl.speakeasy.net $ set | grep TMOUT $ Read from remote host ud00: Connection reset by peer Connection to ud00 closed. $ ssh KeepAlive Option? Nope!$ cat /home/mudd/.ssh/config KeepAlive yes $ $ ssh ud00 Last login: Wed Aug 2 13:43:47 2006 from dsl027-167-091.atl1.dsl.speakeasy.net $ Read from remote host ud00: Connection reset by peer Connection to ud00 closed. $ $ rm /home/mudd/.ssh/config $ Ignore Signals? Nope!$ ssh ud00 Last login: Wed Aug 2 10:43:40 2006 from dsl027-167-091.atl1.dsl.speakeasy.net $ trap '' 1 2 # Ignore SIGHUP and SIGINT $ date Wed Aug 2 14:43:42 EDT 2006 $ Read from remote host ud00: Connection reset by peer Connection to ud00 closed. $ Xclock works, I just wish there was a simpler way.$ ssh ud00 Last login: Wed Aug 2 16:28:22 2006 from dsl027-167-091.atl1.dsl.speakeasy.net $ xclock [1] 5835 $ ssh_config - OpenSSH SSH client configuration files. It works!!
From "man ssh_config":
ServerAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the server, ssh will send a message through
the encrypted channel to request a response from the server. The
default is 0, indicating that these messages will not be sent to
the server, or 300 if the BatchMode option is set.
ProtocolKeepAlives is a Debian-specific compatibility alias for
this option.
Before adding option:
$ ssh od00
mudd@od00's password:
$ Read from remote host od00: Connection timed out
Connection to od00 closed.
After adding option:
$ ssh -v
OpenSSH_4.2p1 Debian-7ubuntu3, OpenSSL 0.9.8a 11 Oct 2005
$
$ cat ~/.ssh/config
ServerAliveInterval 300
$
$ ssh od00
mudd@od00's password:
$
No timeout after being connected and idle all night long!!!
last updated 2 years ago # |
HomeBlog |