Operating System - HP-UX
1751738 Members
5841 Online
108781 Solutions
New Discussion юеВ

Re: How to Lock the terminal automatically

 
Arun Jain
Frequent Advisor

How to Lock the terminal automatically

Dear All,

As you know that LOCK command can be used to lock the terminal, but this method is not automated.
I want a method so that after a certain amount of time, my terminal gets locked or the system gets log off.
Please suggest.

Regards:
Arun Jain
speak less say more
3 REPLIES 3
Yogeeraj_1
Honored Contributor

Re: How to Lock the terminal automatically

hi Arun Jain,

You can look into the TMOUT environment variable.


Normally the shell will support some sort of auto logout option. You need to use TMOUT variable. You can setup TMOUT in seconds, the shell terminates after waiting for that number of seconds if input does not arrive. For example if you setup TMOUT 60 seconds:

$ export TMOUT=60

So, if no input (command typed) arrived it will terminate the shell.

You can add TMOUT to your shell configuration file ~/.profile file.

For more info, see also:
http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1204876320855+28353475&threadId=111518


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Arun Jain
Frequent Advisor

Re: How to Lock the terminal automatically

Hi yogeeraj,

I put export TMOUT=5 in ~/.profile.
Now the thing is if I only put export TMOUT in the .profile, then also it flash a message that
"Shell will time out in 60 seconds." after sometime...
Now tell me, I dont want to see this msg. I want that as soon as shell reaches that point (if the time is specified), it should logout the session not flash a message like above, what should I do...

Regards:
Arun
speak less say more
Yogeeraj_1
Honored Contributor

Re: How to Lock the terminal automatically

hi,

Unfortunately, this is default response of the shell. I don't know if there is another variable that can inhibit this message...

I leave it to the other Gurus to comment on this...


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)