![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tinylogin telnet idle timeout | jing han | Forum Support Area for Unregistered Users & Account Problems | 1 | 05-13-2008 05:16 PM |
| Solaris 8 - Session timeout | civic2005 | SUN Solaris | 3 | 04-22-2008 03:12 AM |
| Disable telnet timeout | ayhanne | SUN Solaris | 2 | 03-14-2007 03:13 AM |
| solaris telnet idle timeout | kahn630 | UNIX for Dummies Questions & Answers | 1 | 04-14-2005 09:23 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
telnet session timeout
hi, we can set something such that if the user has been idle for a while, it will auto disconnect. where to do so? thanks
|
| Forum Sponsor | ||
|
|
|
|||
|
if my guess is right, you are looking for a way to
log off idle users? right you could write a script to log off idle users here is a korn shell script that could log off users that is idle for more than 60minutes or 1 hour, this script log off idle user apart from root users and users log on to the console #!/usr/bin/ksh who -u | sed -e "s/\./0/" -e "s/://g" |awk '$6 > 60 {print $1" "$2" "$7}' | \ while read -r NAME TER PID do if [ "$NAME" = "root" ] then echo " Idle root users can not be log off " >/dev/null else if [ "$TER" = "console" ] then echo "user logged in at the console can not be log off " >/dev/null else kill -9 $PID fi fi done |
|
|||
|
idle users???
if this is for solaris you can set the TMOUT variable like this.
# TMOUT=900# export TMOUT the 900 is in seconds set this prameter in /etc/profile or in each users home directory in .profile file. Holistic |
|
||||
|
You may want to write your own script - I'm trying to stay objective, but that script is flawed.
First off, those echo statements are being redirected to /dev/null. What's the point? And it uses kill -9 right away, which is a Bad Thing if your users have anything running or any processes backgrounded. Also, I've seen problems with killing off a user very harshly like that that can mess up their entries in w or who, saying they exist even though they don't. You'll also end up with orphaned processes that way... One alternative that I've seen is idled: http://www.darkwing.com/idled/ It's a little cleaner than crashing around in the dark "kill -9"'ing processes automatically. |