Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Idle ssh users

Idle ssh users

2006-01-27       - By A.Fadyushin@(protected)

 Back
Reply:     1     2     3     4  

If your users are using bash as their shell and just forget to log out
after they no longer need a shell session (so the shell is still waiting
for the user to enter something at the command prompt) you can use the
bash's environment variable TMOUT. That variable contains the number of
second which bash will wait for the user to enter the command at the
prompt. If the sessions is idle (at the command prompt) for that number
of seconds bash will terminate and the user will be logged out. This
variable could be set in global or per user .profile files. Of course,
the users can reset this value if they need a longer period of waiting
at the command prompt so this limit can not be strictly enforced by the
system administrator. However, the users who forget to log out most
probably will forget to change this value also.

Alexey Fadyushin
Brainbench MVP for Linux.
http://www.brainbench.com

> -- --Original Message-- --
> From: redhat-install-list-bounces@(protected)
[mailto:redhat-install-list-
> bounces@(protected)] On Behalf Of Rick Stevens
> Sent: Thursday, January 26, 2006 10:17 PM
> To: Getting started with Red Hat Linux
> Subject: Re: Idle ssh users
>
> On Thu, 2006-01-26 at 11:22 -0700, redhat@(protected) wrote:
> > On occasion we have have people login via ssh to some of our RH
linux
> > systems and they do not log out.  When doing a "w" or
> > "who" we see idle connections for days sometimes.  What is the
> > recommended way to log these users out?  Is there a better way than
just
> > killing the users ssh process?
>
> Not really.  You can write a script that parses the output of the
"last"
> or "who" commands and kills off the processes involved.  For example:
>
>     #!/bin/bash
>     PATH=$PATH;/usr/bin;/bin
>     WHOLIST=`who -u`
>     for LINE in $WHOLIST; do
>   echo $LINE | awk '{if (index($6, "old")) system("kill "$7);}'
>     done
>
> would kill any user's login process that had been idle for over a day.
> I'd set that up as a shell script and run a cron job for it every, oh,
> four hours or so, depending on what you want to do.
>
> See "info who" for details on the "-u" option.
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> - Rick Stevens, Senior Systems Engineer     rstevens@(protected) -
> - VitalStream, Inc.                       http://www.vitalstream.com -
> -                                                                    -
> -  You know the old saying--any technology sufficiently advanced is  -
> -               indistinguishable from a Perl script                 -
> -                                 --Programming Perl, 2nd Edition    -
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> Redhat-install-list mailing list
> Redhat-install-list@(protected)
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request@(protected)
> Subject: unsubscribe

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Redhat-install-list mailing list
Redhat-install-list@(protected)
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@(protected)
Subject: unsubscribe

Earn $52 per hosting referral at Lunarpages.