LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 04-24-2008, 01:51 PM   #1
vm_devadas
Member
 
Registered: Sep 2006
Location: India
Distribution: Redhat and Suse
Posts: 73

Rep: Reputation: 15
idle time out for root in physical console


Is there any method in suse linux (sles 9) for making idle time out for root in physical console ?

That means when a root user(or any other user) logs in to the session he need to loged out if the session is idle for 5 minutes.

Please help
 
Old 04-25-2008, 07:18 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: OpenSUSE 12.1 CentOS 6.2
Posts: 9,010

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
What do you mean for physical console? In bash you can set the TIMEOUT for a session by the environment variable TMOUT, for example if you open a terminal and issue
Code:
export TMOUT=300
the session will end and the terminal will close after 5 minutes of inactivity. You can set the variable in .bashrc for root and the trick is done.

In KDE you can also setup a timeout for the X session. Since KDE 3.4 this is a feature of the screensaver. You have to edit the file $HOME/.kde/share/config/kdesktoprc and under the screen-saver section add
Code:
AutoLogout=true
AutoLogoutTimeout=300
I don't know for GNOME sessions or for other desktop managers, but maybe there is a similar feature.
 
Old 03-17-2009, 02:24 AM   #3
ryannlinux
LQ Newbie
 
Registered: Feb 2009
Location: Kuala Lumpur
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Question

Hi guys, the 'export TMOUT=300' is a temporary solution, this is gone once you close the terminal session or reboot your system... how do we apply this permanently? Thanks.
 
Old 03-17-2009, 10:25 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: OpenSUSE 12.1 CentOS 6.2
Posts: 9,010

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
As stated in my previous post, "you can set the variable in .bashrc". Take in mind this is a timeout feature of the shell: only a terminal or a console will be affected, not the X environment.
 
Old 03-17-2009, 12:04 PM   #5
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x), Solaris (8-10), Tru64
Posts: 738

Rep: Reputation: 41
Quote:
Originally Posted by ryannlinux View Post
Hi guys, the 'export TMOUT=300' is a temporary solution, this is gone once you close the terminal session or reboot your system... how do we apply this permanently? Thanks.
Place something like the following in the profile:
Code:
if [ "${USER}" == "root" ]
then
   export TMOUT=300
fi
When "root" logs in, this would set the timeout but leave no timeout for everyone else.

I suspect this won't work if you're logged in as Joe Normal and running something like YaST in X that needs root privileges to execute. Worth a try though; leaving YaST running forever shouldn't really be necessary.

Cheers...
Rick
 
Old 03-17-2009, 11:14 PM   #6
ryannlinux
LQ Newbie
 
Registered: Feb 2009
Location: Kuala Lumpur
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Tnx rnturn. I tried analyzing /etc/profile and did this instead:

- set TMOUT=300
- added TMOUT value on (export PATH USER MAIL TMOUT)

Now this works for who ever logs in.

Thanks again!
 
  


Reply

Tags
idle, time


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic log out session in physical console vm_devadas Linux - Server 1 04-24-2008 03:58 PM
Find X idle time jlinkels Linux - Software 2 01-25-2007 06:02 PM
idle timeout for linux console car182 Linux - Security 1 10-17-2006 04:43 PM
Determining last login from a physical console DiscoGranny Linux - Security 2 02-03-2005 12:17 PM
How to find out idle time at console? redss Linux - General 1 04-26-2004 10:23 PM


All times are GMT -5. The time now is 12:03 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration