The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 08:16 PM
Solaris 8 - Session timeout civic2005 SUN Solaris 3 04-22-2008 06:12 AM
Disable telnet timeout ayhanne SUN Solaris 2 03-14-2007 07:13 AM
solaris telnet idle timeout kahn630 UNIX for Dummies Questions & Answers 1 04-14-2005 12:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-15-2002
yls177
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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
  #2 (permalink)  
Old 10-15-2002
hassan2 hassan2 is offline Forum Advisor  
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
champion champion is offline
Registered User
  
 

Join Date: Jul 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
Bits: 0 [Banking]
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
Holistic Holistic is offline
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
LivinFree LivinFree is offline Forum Advisor  
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
Bits: 0 [Banking]
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0