1753830 Members
9611 Online
108806 Solutions
New Discussion юеВ

Re: Inactivity Logout

 
SOLVED
Go to solution
Fred K. Abell Jr._1
Regular Advisor

Inactivity Logout

Using CDE and running HP-UX 11.11 on J6750 workstation, I want to make accounts log totally off after a certain period of inactivity. Currently the terminal locks and requires other users to use the root password to unlock, which presents itsтАЩ own set of problems. Getting users to act responsibility is out of the question. Thanks in advance.

Fred
14 REPLIES 14
Dennis Handly
Acclaimed Contributor
Solution

Re: Inactivity Logout

In a real shell, you can set TMOUT to log it out after that many idle seconds.
Steven E. Protter
Exalted Contributor

Re: Inactivity Logout

Shalom Fred,

TMOUT will work for shell sessions that are idle.

Once an app is fired up, the app needs to take care of this function.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hakki Aydin Ucar
Honored Contributor

Re: Inactivity Logout

As an example by default;

# echo $TMOUT
0
# export TMOUT=5
# echo $TMOUT
5
#
Shell will time out in 60 seconds.
rariasn
Honored Contributor

Re: Inactivity Logout

Hi Fred:

TMOUT:

You can configure the TMOUT variable to automatically lock inactive terminals.
If you use other systems often and if you copy the .profile file from one system to
another, then adding the TMOUT variable to the .profile is more convenient. If you
typically stay on one system, then either method of locking the terminal can be used.
To configure the TMOUT variable, edit the .profile file as shown in the following:
# vi ~/.profile
export TMOUT=600 # (lock after 600 seconds of inactivity)
You can change the 600 to another desired value.

CDE LOCK:
You can configure the CDE lock manager to lock your screen after a certain amount of
inactive time. To configure the CDE lock manager to lock the screen after 10 minutes
of inactive time, enter the following commands:

# cp /usr/dt/config/C/sys.resources /etc/dt/config/C/sys.resources
# vi /etc/dt/config/C/sys.resources
dtsession*lockTimeout: 10

You can also use the Style Manager task panel to adjust the CDE lock manager. To do
this, click on the screen icon.

rgs,
Matti_Kurkela
Honored Contributor

Re: Inactivity Logout

When you're using CDE, the inactivity logout is trickier to implement, because there isn't necessarily any terminals active. Also you'd want to logout the entire CDE session, not just the terminals.

If you send a "kill -HUP" to the user's dtsession process, that should kill the entire CDE session in a controlled fashion.

I don't have a workstation system available right now so I cannot check... but if the screen saver/locker causes a recognizable process to appear when it's active, it might be possible to use it as "inactivity indicator", so a relatively simple script or program should be able to detect the sessions that have been inactive for too long.

Pseudo-code:

if (there is a dtsession process running) {
identify the user running the session
if (the session has a screensaver running) {
find the start time of the screensaver process
screensaver.runtime = current_time - screensaver.starttime
if (screensaver.runtime > inactivity limit) {
kill -HUP
}
}
}

MK
MK
Dennis Handly
Acclaimed Contributor

Re: Inactivity Logout

>Hakki: export TMOUT=5
>Shell will time out in 60 seconds.

That's 5 seconds.
Hakki Aydin Ucar
Honored Contributor

Re: Inactivity Logout

>Dennis: >>Hakki: export TMOUT=5
>>Shell will time out in 60 seconds.

>That's 5 seconds.

Yes , it is weird, is there any other parameter to set minimum timeout like 60 seconds ??

$ uname -a
HP-UX igui01 B.11.11 U 9000/800 1889900691 unlimited-user license

$ export TMOUT=1
$
shell time out in 60 seconds
$ export TMOUT=61
$ echo $TMOUT
61
$
shell time out in 60 seconds
Dennis Handly
Acclaimed Contributor

Re: Inactivity Logout

>Hakki: it is weird, is there any other parameter to set minimum timeout like 60 seconds?

Hmm, you're saying it doesn't work as documented?
I suppose we could use tusc to see how it works.
Jim Walls
Trusted Contributor

Re: Inactivity Logout

I've run some experiments on an 11.23 server and it appears, to me, that the value of TMOUT works as fiollows:

export TMOUT=120

after an elapse of about two minute I get the...

Shell will time out in 60 seconds.

...prompt. A minute later the session disconnects.

If I interact before the 60 seconds expire, then I get another two minutes before being prompted again.

So, from my observation it seems to work, more or less, as expected.

The 60 second warning does not appear if I'm using bash but the session terminates all the same!