Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a DSL modem internet connection at home and when I am logged in to my dedicated internet server using ssh, the modem times out my connections when they are idle. The result is, I am accumulating dead ssh connections being idle for days (wasting system resources) that I have to kill with -9 periodically. This is how they look like when I ps:
I know I can setup ssh client with keep-alive and it will send some data to avoid the connection being expired by the firewall of the modem, but I don't want this (since it is not a clean solution). I want the ssh daemon to kill idle connections and the resulting child processes automatically after some inactivity period (which I can configure somewhere). Is this possible?
My OS is a bit old: centos-release-5-2.el5.centos , hope this is not an issue, I just can't upgrade this server right now, its a productive environment.
Will appreciate any comments very much on this case.
Thanks
it is not clean because if the modem is reset and new ip is assigned, the connections will remain on the server side.
If that's a regular concern, then consider using GNU screen or tmux.
I often work during my bus ride in to work. (The connection quality is terrible, and is dropped at least once during the ride.) With tmux, I simply re-attach session when the connection is active again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.