LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


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

Rep: Reputation: 15
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-
 
Old 05-23-2005, 06:59 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
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
 
Old 05-23-2005, 07:04 PM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
That's a great tip
 
Old 05-23-2005, 07:51 PM   #4
-0-
Member
 
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 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.

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


Reply



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 03:51 PM
How to Run Win32 Console App in linux Console Lokie Linux - Software 2 08-12-2004 10:00 PM
Xserver screen locking/virtual console security rfarma5 Linux - Security 2 06-23-2004 05:36 PM
Locking Console Screen for Slackware kemplej Linux - Security 1 06-14-2004 02:06 PM
Locking a console Stephanie Linux - General 1 01-18-2002 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:26 PM.

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