• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 762
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

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