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!
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 did some googling, and everything seems to say to
add the following two things into /etc/ssh/sshd_config
ClientAliveInterval 600
ClientAliveCountMax 3
But when I look at an existing server we have that disconnects a putty session if left idle, those two settings are commented out in the file. Maybe I'm searching for the wrong thing, or there's another way to do it?
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
Samba does something similar ie lines beginning with '#' are doc comments, lines beginning with ';' are like ssh; default values commented out.
OK, on the server i'm looking at that disconnects, and the new one that doesn't appear to (or maybe it's just set to some much great value perhaps), the two settings mentioned above both have # in front of them and both have the same number. So I'm thinking there has to be another spot to set this, maybe?
I guess I'm not understanding how if it's commented out on a server that does timeout a session after a period just like it is on this server, how it is this setting even. unless i'm just totally missing something here.
If(?) I understand your qn (& it is a bit confusing I agree), here is the situation.
At install time, sshd_config is pre-created for you, with the most-likely-to-be-required options already specified in the file.
The default values are used/set, BUT the line in the cfg file marks them as commented out (nonetheless, they ARE active).
This enables you to easily see which options are in the default setting and what those values are.
It also saves you having to guess/research a reasonable value for it.
If a setting is NOT commented out, it has likely been amended by a human being.
In Samba they use '#' & ';' to distinguish between doc comments ( # ) and default settings values ( ; ).
Yeah, I gotcha now. Kinda odd in my mind that is uses default settings, but it leaves them commented out, you'd think it just have them in there uncommented set to the default value, then still have the note in the comments. Or at least that's how i'd do it haha.
I'm going to open up a session to that server and just let it sit for a few hours, see if it disconnects me or not. Maybe I really didn't have to do anything in the first place, other than not work so much on the server haha.
Thanks for the help Chris, you are always extremely helpful, and can break it down into something I can understand.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.