When I use ssh to log in a remote server and open vim, if I don’t type any words the session will timeout and I have to log in again.
But if I run command like top the session will never timeout?
What’s the reason?
When I use ssh to log in a remote server and open vim, if
Share
Note that the behavior you’re seeing isn’t related to
vimor totop. Chances are good some router along the way is culling “dead” TCP sessions. This is often done by a NAT firewall or a stateful firewall to reduce memory pressure and protect against simple denial of service attacks.Probably the
ServerAliveIntervalconfiguration option can keep your idle-looking sessions from being reaped:Try adding
ServerAliveInterval 180to your~/.ssh/configfile. This will ask for the keepalive probes every three minutes, which should be faster than many firewall timeouts.