Sponsored Content
Full Discussion: telnet session timeout
Top Forums UNIX for Dummies Questions & Answers telnet session timeout Post 29989 by hassan2 on Tuesday 15th of October 2002 07:45:23 AM
Old 10-15-2002
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
 

8 More Discussions You Might Find Interesting

1. Solaris

Solaris 8 - Session timeout

Hi, anyone Audit requirement to set the Solaris 8 server session timeout to 180 sec , Please advice how can I do it .... Thanks (3 Replies)
Discussion started by: civic2005
3 Replies

2. Shell Programming and Scripting

session timeout for shell script

I am executing test.sh script. But this script takes lot of time and in the meantime the shell timeouts without completing the script. Is there any command which will continue processing the script. Thanks (3 Replies)
Discussion started by: infyanurag
3 Replies

3. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

4. AIX

Unix session timeout?

We recently moved servers to a new data center, and now we're experiencing user sessions timing out after non-activity. We didnt experience this before, or know of any timeout settings that may have been changed. Any things I can check out on the server? (3 Replies)
Discussion started by: NycUnxer
3 Replies

5. UNIX for Dummies Questions & Answers

Putty Session Timeout

Hi, I had add the following line into .profile and .bash_profile for the timeout session to avoid putty close automatically : timeout=10800 However, i still keep encounter session time out every after 60 seconds. Can anyone please help advice. Many Thanks! (2 Replies)
Discussion started by: wancy
2 Replies

6. Solaris

Session timeout setting in server

Hi All I need to set timeout of login session of a user if a user is idle for some time. I know the TMOUT setting but it work with only BASH & KORN shell only as I need to set for Bourne shell also. I am trying to put "ClientAliveInterval 300" in sshd_config & restart or refreshing the... (1 Reply)
Discussion started by: sb200
1 Replies

7. AIX

Set timeout value for ssh session to HMC?

Friends, Could anyone let me know - how to set the timeout value for ssh session to HMC? My HMC version is -- V7R7.4.0. I'm sure the version doesn't have anything to do with it. Thanks, -- Souvik (2 Replies)
Discussion started by: thisissouvik
2 Replies

8. Linux

Is it possible to set timeout on Linux screen session

Hello friends, I work on Linux servers via SSH (putty) and run "screen" to preserve my sessions so I can attach/detach them at anytime I wish without losing the connectivity/process disruption which is working perfectly fine. As my team members also have root access to those servers, it is... (7 Replies)
Discussion started by: prvnrk
7 Replies
WHO(1)							    BSD General Commands Manual 						    WHO(1)

NAME
who -- display who is on the system SYNOPSIS
who [-abHmqsTu] [am I] [file] DESCRIPTION
The who utility displays information about currently logged in users. By default, this includes the login name, tty name, date and time of login and remote hostname if not local. The options are as follows: -a Equivalent to -bTu, with the exception that output is not restricted to the time and date of the last system reboot. -b Write the time and date of the last system reboot. -H Write column headings above the output. -m Show information about the terminal attached to standard input only. -q ``Quick mode'': List the names and number of logged in users in columns. All other command line options are ignored. -s Show the name, line and time fields only. This is the default. -T Indicate whether each user is accepting messages. One of the following characters is written: + User is accepting messages. - User is not accepting messages. ? An error occurred. -u Show idle time for each user in hours and minutes as hh:mm, '.' if the user has been idle less than a minute, and ``old'' if the user has been idle more than 24 hours. am I Equivalent to -m. By default, who gathers information from the file /var/run/utx.active. An alternate file may be specified which is usually /var/log/utx.log (or /var/log/utx.log.[0-6] depending on site policy as utx.log can grow quite large and daily versions may or may not be kept around after compression by ac(8)). The utx.log file contains a record of every login, logout, crash, shutdown and date change since utx.log was last truncated or created. If /var/log/utx.log is being used as the file, the user name may be empty or one of the special characters '|', '}' and '~'. Logouts produce an output line without any user name. For more information on the special characters, see getutxent(3). ENVIRONMENT
The COLUMNS, LANG, LC_ALL and LC_TIME environment variables affect the execution of who as described in environ(7). FILES
/var/run/utx.active /var/log/utx.log /var/log/utx.log.[0-6] EXIT STATUS
The who utility exits 0 on success, and >0 if an error occurs. SEE ALSO
last(1), users(1), w(1), getutxent(3) STANDARDS
The who utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A who command appeared in Version 1 AT&T UNIX. BSD
February 11, 2012 BSD
All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy