Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Say someone starts a SSH session through Putty to a CentOS box, and they leave it sit idle for a while. Where can I set an idle timeout so it will disconnect any sessions idle for a certain time period?
In the /etc/ssh/sshd_config file, uncomment and change the ClientAliveInterval, then restart the sshd services. According to the MAN page of sshd_config:
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. The default is 0, indicating that these messages will
not be sent to the client. This option applies to protocol version 2 only.
ClientAliveInterval 60 would drop the connection after 60 seconds of inactivity.
ok, because looking at another server, I don't see that setting configured in the main config file, and in the user's ~/.ssh/ I don't see a config file. I think I'm either missing something, or maybe there's another way to cause a similar outcome? or it was just a default setting in older versions that did it no matter what, which is why I can't find it. not a big deal, i'm just confused.
Ah ok, so it's only the global setting in the main config file then. Still makes me wonder why other older servers will disconnect an idle ssh session if they don't have that set. Maybe there's a different setting out there that disconnect any idle connect (not connection type specific).
maybe it's the shell killing the session on those other servers. I'm going to test it again, but on this new server, I don't think it's killing sessions either with only ClientAliveInterval set. maybe i need to enable another setting in there that goes with it.
I'll post back if i've gone crazy and idle sessions actually are killed with just that setting