• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 756
  • Last Modified:

how to disconnect idle users from a server ?

Hello ...
I need to do something to disconnect idle users from my shell server automatically after 1 minute since they haven't pressed any key ... can this be done ?

Thanks
0
keepwalking
Asked:
keepwalking
  • 3
  • 2
1 Solution
 
ahoffmannCommented:
> ..  shell server  ..
so they are logged in into a shell?
then simply enforce the autologout environment variable:
TMOUT=60;export TMOUT; # bash, ksh, pdksh
set autologout=60; # csh, tcsh

some systems also support a TIMEOUT=60 in /etc/default/login
0
 
keepwalkingAuthor Commented:
not after 60 seconds but after 60 seconds of no command input no key pressed
0
 
ahoffmannCommented:
and what is different to what I suggest?
0
 
keepwalkingAuthor Commented:
ugh one more thing ...  i want the rule active only for group users ... i don't want root to be disconnected :)
0
 
ahoffmannCommented:
if you have made the change in /etc/profile or a like, you need to check $USER, somthing like:
[ "`id -ng $USER`" = "users" ] && TMOUT=60
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now