LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


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

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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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: NZ
Distribution: Ubuntu
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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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: NZ
Distribution: Ubuntu
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



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
Find X idle time jlinkels Linux - Software 4 08-16-2013 03:19 PM
automatic log out session in physical console vm_devadas Linux - Server 1 04-24-2008 03:58 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:14 AM.

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