lock the console after 5 minutes of inactivity.
How would i force The server console to be locked automatically after 5 minutes ?
I want it to happen for X as well as terminal session of the machine. My Linux distribution details. Code:
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch |
In Fedora13,you can do it using GUI through System-->Preferences--->ScreenSaver---->Lock Screen After (5mins)....
let u know how to do change timimg from command promt |
Quote:
Server mentioned above dont have GUI console How can this be implemented for terminal sessions? |
Have you looked at either "away" or "vlock"?
Cheers, Evo2. |
Quote:
Both the commands not working on the servers. |
Quote:
Without installing anything you can use the TMOUT variable (works in Korn and Bash, not sure for others). Just set in either profile or .bashrc: Code:
export TMOUT=300 Kind regards, Eric |
Hi,
Quote:
Quote:
... or do you mean they are not installed? Evo2. |
Quote:
It seems i will have to manually do this for every user created on the system. Will it work , if a default shell of user is not bash ? |
Quote:
It seems i will have to manually do this for every user created on the system. Will it work , if a default shell of user is not bash ? Can't it be done by analyzing output of w command. I know i will have to write a script and scheduled it using crontab. Is there any other alternative for the same. |
Depending on the system in use you could just put
that time-out into a system wide file, e.g.: /etc/profile Something like readonly TMOUT=300 That way users can't override it from their own initialisation files. Cheers, Tink |
Hi,
From the bash man page: Quote:
As indicated I only know it works in Bash and Korn, you'll have to try for yourself if you use other shells. Quote:
What script do you think you have to write? One to activate the timeout? That's completely unnecessary because it's applied on EVERY login if you put it in the /etc/profile file, so no need for a script nor crontab reference. Alternatives have been pointed out by evo2. Kind regards, Eric |
Quote:
Kind regards, Eric |
Thanks all for your helpful input.
This is what i m going to do. 1) edit /etc/profile file with readonly TMOUT=300 value. This will ensure that every user get logout if they keep their terminal inactive for 5 minute. This also ensures that they can't override the parameter as readonly option is used instead of simple export TMOUT=300. Correct me if i m wrong. |
Quote:
Looks OK to me, but again, if you're using another shell than Bash or Korn, test it. Kind regards, Eric |
All times are GMT -5. The time now is 02:53 PM. |