automatic logout

A.Fadyushin at it-centre.ru A.Fadyushin at it-centre.ru
Fri Jul 28 11:32:54 UTC 2006


You can place the definition of the environment variable TMOUT in SSH
configuration files, so it will be applied only to ssh sessions. You can
use files /etc/ssh/sshrc, ~/.ssh/rc (per user), ~/.ssh/environment (per
user, you will need to enable it in sshd_config).

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

> -----Original Message-----
> From: redhat-list-bounces at redhat.com [mailto:redhat-list-
> bounces at redhat.com] On Behalf Of Tom Hansen
> Sent: Thursday, July 27, 2006 1:50 AM
> To: General Red Hat Linux discussion list
> Subject: Re: automatic logout
> 
> Maybe you could try something like this in /etc/profile:
> 
> if (grep sshd /proc/$PPID/cmdline >/dev/null 2>&1); then
>     export TMOUT=whatever
> fi
> 
> 
> Bill Tangren wrote:
> > I am required to configure my servers so that anyone who logs in via
> > ssh or sftp
> > will be logged out after 30 minutes of inactivity. I have looked
> > through the
> > openssh documentation and have seen nothing on how do to this
> > (ClientAliveInterval doesn't seem to do this). Googling didn't help
> > much either. I found an environment variable for the bash and ksh
> > shells that I can put in /etc/profile:
> >
> > # export TMOUT=<timeout_in_seconds>
> >
> > and this works, but it unceremoniously dumps the connection. And, if
> > you are
> > logged in to the gui at the console, and you have terminal windows
> > open (not
> > using ssh) it will close those too. Again with no warning.
> >
> > Does anyone have any suggestions?
> >
> > Bill Tangren
> >
> >
> >
> >
> 
> --
> Tom Hansen
> Senior Information Processing Consultant
> Great Lakes WATER Institute
> tomh at uwm.edu
> www.glwi.uwm.edu
> 
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list