The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-15-2002
yls177
Guest
 

Posts: n/a
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
  #2 (permalink)  
Old 10-15-2002
Registered User
 

Join Date: Mar 2002
Location: London, England
Posts: 262
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
  #3 (permalink)  
Old 10-15-2002
Registered User
 

Join Date: Jun 2002
Posts: 64
this is terrific!

pls tell me where to put file to and how and when to execute this file.

thank you very much.
  #4 (permalink)  
Old 10-15-2002
yls177
Guest
 

Posts: n/a
then this script must be running all the while?
but in the resource point of view, doesnt it take up resources?
thanks
  #5 (permalink)  
Old 10-16-2002
Registered User
 

Join Date: Jul 2001
Location: dc
Posts: 25
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
  #6 (permalink)  
Old 10-16-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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.
  #7 (permalink)  
Old 10-16-2002
yls177
Guest
 

Posts: n/a
in solaris, we can do the below

# TMOUT=900# export TMOUT

the 900 is in seconds
set this prameter in /etc/profile or in each users home directory in .profile file.

is there any equivalent in ibm aix or hpux. thanks
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0