Many graphical SSH clients, like SecureCRT or PuTTY, also have options for sending null packets, NOOPs, or keepalive, just look in their options. By default it’s three, so if your remote host doesn’t respond in three intervals it’ll close the connection. There is also the ServerAliveCountMax, which governs how many times it’ll try keeping the session alive before it closes it. If you want to set the keep alive for the server, add this to /etc/ssh/sshdconfig: ClientAliveInterval 60 ClientAliveCountMax 2 ClientAliveInterval: Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. In these examples 120 is the number of seconds between keepalives. Last, you could always stick it in the main client config file, usually /etc/ssh/ssh_config: ServerAliveInterval 120 The Host part of this configuration can also be set to a specific host, or a specific pattern (look in the ssh_config man page, way at the end under PATTERNS), if you have varying needs. If you don’t already have a ~/.ssh/config file make sure to chmod it to 600 so it doesn’t complain about permissions. Better yet, you could also put it in ~/.ssh/config so it always takes effect: Host * There should be no more random when using the Putty terminal with that linux server. edit /.inputrc (create a new file if it doesnt exist) add the line 'e 28':''. You can do it from the command line: ssh -o ServerAliveInterval=120 Īnd you could alias ssh to “ssh -o ServerAliveInterval=120” in. Now you can bind this key to blank so that when Caffeine simulates it, it wont type. SSH protocol version 2 supports server keepalive, essentially NOOPs sent to the server to keep the connection up. I could ask our network guys to change the timeouts, but it turns out there’s a better fix from the client side. Let the connection sit for a while and you’ll have to recreate it. It also happens in various other situations, like NAT through a home router, too. It’s particularly inconvenient when I’m tailing a log that hasn’t changed in a while… and then the connection dies, and I don’t notice. With the installation of new firewalls at work I’ve been getting disconnected a lot from hosts I SSH to, due to changes in the inactivity timeouts.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |