LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2006, 04:02 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
kick idle users off the system


I got users logged on to the system (via ssh) and not logging out of their connection. I was wondering how I could kick out users who are idle more than 'x' days.
 
Old 10-26-2006, 11:36 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Take a look at the ClientAliveInterval and ClientAliveCountMax setting (part of your sshd_config).

Quote:
The default (for ClientAliveCountMax) value is 3. If ClientAliveInterval (above) is set to 15, and ClientAliveCountMax is left at the default, responsive ssh clients will be disconnected after approximately 45 seconds.
See man sshd_config for full details.

Hope this helps.
 
Old 11-21-2006, 06:51 PM   #3
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
I used

ClientAliveInterval 15
ClientAliveCountMax 3

which should kick idle users in 45 seconds (according to the sshd_concig(5)). But if I do a w(1), I can still see the user logged in!
 
Old 11-21-2006, 06:58 PM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Maybe the user isn't idle????
 
Old 11-21-2006, 07:03 PM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
For idle shells, you could set the TMOUT variable. Of course, users can over-ride this in their personal .bashrc files, but most won't bother. This won't work if the user has some program in the foreground.
 
Old 11-22-2006, 06:15 AM   #6
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
TMOUT works fine. Thanks.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convient & policte way to kick users off system? mattengland Linux - Security 15 10-04-2005 08:20 AM
Kick existing connected users loadedmind Linux - Security 4 07-26-2005 07:55 AM
Kick and log users on SSH Quantum0726 Linux - Security 5 01-02-2004 09:10 AM
idle users klfreese Linux - Newbie 1 07-20-2003 11:57 PM
How do disconnect Idle users?? noodle123 Linux - Newbie 2 07-29-2002 08:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:48 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