LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-01-2022, 11:26 AM   #1
jgauthier
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Rep: Reputation: 1
SSH inactivity logout disabled in 8.6?


I realized yesterday that all my computers that have been updated to the 8.6 version don't kick me out from inactive ssh sessions anymore. After some googling, I found that in the RHEL 8.6 release notes:

sshd_config:ClientAliveCountMax=0 disables connection termination

Setting the SSHD configuration option ClientAliveCountMax to 0 now disables connection termination. This aligns the behavior of this option with the upstream. As a consequence, OpenSSH no longer disconnects idle SSH users when it reaches the timeout configured by the ClientAliveInterval option.


So, according to that, I cannot set an idle auto-logout for the ssh sessions anymore, which is mandatory inside my organization network. How are we supposed to do now? I know the TMOUT variable can be used in .sh and .csh profiles (we already use it for our servers) but it also kills the local terminals, which is not suitable for desktop computers (but we still have to logout inactive ssh sessions connected to those). Everywhere I look online, the only way I see to disconnect an idle ssh session is with the ClientAliveCountMax and ClientAliveInterval settings and they don't have any effect anymore.

By the way, setting ClienAliveCountMax to anything else than 0 doesn't work either. Like if I put

ClientAliveInterval = 200
ClienAliveCountMax = 3

I stay connected forever. The only way I had to make that working was to set CountMax to 0 and it doesn't work anymore. Any tips to resolve this problem?

Thank you for your help!

Last edited by jgauthier; 06-02-2022 at 03:02 PM.
 
Old 06-02-2022, 03:03 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
Welcome to LinuxQuestions.

https://bugzilla.redhat.com/show_bug.cgi?id=2015828

When did you last update your systems. Looks like there was an update on 2022-05-10 to fix the bug.
 
Old 06-03-2022, 02:06 PM   #3
jgauthier
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Original Poster
Rep: Reputation: 1
Since I got no reply, I kept on searching and finally found a solution. I have to use TMOUT and autologout but with the condition that SSH_CONNECTION is defined.

For tcsh, create a .csh file in /etc/profile.d (like ssh-timeout.csh) and write

if ($?SSH_CONNECTION) then
unset autologout
# set to 15 min
set -r autologout=15
else
endif


For bash, create a .sh file in /etc/profile.d (like ssh-timeout.sh) and write

if [ "$SSH_CONNECTION" != "" ]; then
TMOUT=900 # 15 mins
readonly TMOUT
export TMOUT
fi



Like that, the local terminals are not killed but the ssh sessions get disconnected after 15 minutes of idle.

Last edited by jgauthier; 06-03-2022 at 02:25 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run command on ssh inactivity? lil_drummaboy Linux - Security 6 12-15-2020 11:27 AM
server no-gui logout after inactivity sniper8752 Linux - Newbie 1 05-02-2014 12:05 PM
Automatic Logout after inactivity from KDE jst1 Linux - Newbie 2 02-23-2005 01:28 AM
Automatic Logout after inactivity from KDE Suse 9.2 jst1 SUSE / openSUSE 0 02-21-2005 02:05 PM
How do I automatically logout after a period of inactivity? AshleyK Linux - Security 4 12-31-2004 10:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration