Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 05-23-2005, 07:28 PM   #1
Registered: Nov 2004
Location: London uk
Distribution: Slack 10
Posts: 67

Rep: Reputation: 15
Locking the console


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)


Old 05-23-2005, 07:59 PM   #2
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
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:
#Check if it's root
if [ "`id -u`" = "0" ]; then
    #60 seconds * 5 (minutes) = 300
    export TMOUT=300
Old 05-23-2005, 08:04 PM   #3
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
That's a great tip
Old 05-23-2005, 08:51 PM   #4
Registered: Nov 2004
Location: London uk
Distribution: Slack 10
Posts: 67

Original Poster
Rep: Reputation: 15
Having googled for TMOUT and zsh, it appears that it does work

i'd guess that if you insert a 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


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.

Last edited by -0-; 05-23-2005 at 08:59 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
X locking when switching back to console jfall Linux - Hardware 1 02-08-2005 04:51 PM
How to Run Win32 Console App in linux Console Lokie Linux - Software 2 08-12-2004 11:00 PM
Xserver screen locking/virtual console security rfarma5 Linux - Security 2 06-23-2004 06:36 PM
Locking Console Screen for Slackware kemplej Linux - Security 1 06-14-2004 03:06 PM
Locking a console Stephanie Linux - General 1 01-18-2002 11:53 AM > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration