SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.