May
30
This is especially useful for systems which have multiple users with access to the console. One user may lock his or her session while still allowing other users to use the system on other virtual consoles. If desired, the entire console may be locked and virtual console switching disabled. This is really a good idea to lock your workstation which is use to control other servers in your network environment. Generally, KDE and Gnome include a locking feature. The idea is very simple secure your terminal from unwanted people.
Shell variables to auto-logout
Almost all-modern shell support some sort of auto logout option. Under BASH you need to use TMOUT variable. You can setup TMOUT in seconds, bash 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 shell with following message:
timed out waiting for input: auto-logout
You can add TMOUT to your shell configuration file ~/.bash_profile file.
However, I liked tcsh shell (the default shell under FreeBSD) autologout variable. Genral syntax is as follows:
$ set autologout = (VAL1 VAL2)
Where,
VAL1 : The number of minutes of inactivity before automatic logout
VAL2 : The number of minutes of inactivity before automatic locking will take place this is optional.
For example, you can set autologout as follows.
$ set autologout = (5 10)
You can add autologout to your shell configuration file ~/.cshrc OR ~/.tcshrc.
Using lock command under FreeBSD
The lock command requests a password from the user, reads it again for verification and then will normally not relinquish the terminal until the password is repeated.
$ lock
Key: Again: lock: /dev/ttyp0 on fbsd6.freebsd.org.in. timeout in 15 minutes. time now is Tue May 30 20:46:14 IST 2007 Key:
Comments
Leave a Reply

























