LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Locking the console (https://www.linuxquestions.org/questions/slackware-14/locking-the-console-326382/)

-0- 05-23-2005 07:28 PM

Locking the console
 
Hey,

This may be a bit off topic, as it's more of a general thing, but i'm accustomed to posting in slackware (mods please move if you oppose).


I've been pondering ways to increade security on my box, i regualrly lock the screen when i walk away etc.

i was wondering what people think of this idea

use either xscreensaver (or, as i don't like it, xlock, and xautolock (not in slack by default) to lock the screen after say, 5 or 10 mins.

Also, alias startx to "startx &; vlock" to lock the vitual console(s)

However, i'd like to set it so that any su session in xterms expire after about 5 mins of inactivity and exit. However i can't think of a good way to do this, either using normal options, of from a simple script. Does anyone have any ideas how to solve this (i use zsh if it helps)

Thanks

-0-

gbonvehi 05-23-2005 07:59 PM

I don't know if it will work with zsh, but with bash you can use the TMOUT variable to automatically logout.
You can place in /etc/profile something like:
Code:

#Check if it's root
if [ "`id -u`" = "0" ]; then
    #60 seconds * 5 (minutes) = 300
    export TMOUT=300
fi


keefaz 05-23-2005 08:04 PM

That's a great tip ;)

-0- 05-23-2005 08:51 PM

Having googled for TMOUT and zsh, it appears that it does work


i'd guess that if you insert a timeout.sh in /etc/profile.d, according to a similar format from above. then any root session would timeout and exit after a certain amount of time.


best way not to leave a root terminal open IMHO. The only problem that i can see is that you may have to re su if your terminal session logs out, however that's not much of a problem for the security it allows.


sorting that out now. Thanks for the hint

-0-


EDIT: in case anyone tries this and find it doesn't work i reccomend you alias su to su -, as if youare like me you often don't remember to su -, and just do su when you go root, this means the environment is not set, thus TMOUT doesn't get set, and the timeout won't occur.


All times are GMT -5. The time now is 01:19 AM.