Find the answer to your Linux question:
Results 1 to 5 of 5
I need to set an inactivity timeout while in a terminal, in a ssh session, and a GUI session for 15 minutes and ask for a password to get back ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! newbie56's Avatar
    Join Date
    Jan 2009
    Posts
    36

    RHEL5-Inactivity Timeout


    I need to set an inactivity timeout while in a terminal, in a ssh session, and a GUI session for 15 minutes and ask for a password to get back into your session. I have figured out that you can set the screensaver on a GUI session to pop up when inactive for 15 minutes and it asks for a password. My problem is I can't do this for root.

    I modified sshd_config to include the line:

    ClientAliveInterval 300
    ClientAliveCountMax 3

    I tried and this does not work while in a ssh session.

    I also went into /etc/x11/xorg.conf to modify the GUI timeout and it does not work. Here is the code I added to the xorg.conf file:

    Code:
    Section “ServerFlags”
    	Option “BlankTime”  “15”
    EndSection
    What do I need to do to set a global inactivity timeout for the GUI, ssh, and teminal sessions?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,159
    This is not as easy or trivial as it may seem. What if the same user has sessions running on other terminals? If only one session is inactive, but they are active on others, should you shut down the inactive one (losing their work there), or should you log the user out entirely (losing all of their work)? What about background processes that the user is monitoring, but they aren't performing any input or output for extended periods? Do consider all these (and more) scenarios before you try to do this. I have all but murdered IT people who have done this to me in the past when I lost what might have been days or weeks of work monitoring enterprise-critical processes, and I was the senior-most engineer in the company, amongst 2000 other engineers. Let's just say that some folks weren't pleased with their new job assignments - I was a direct report to the corporate VP of Engineering...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined! newbie56's Avatar
    Join Date
    Jan 2009
    Posts
    36

    Rightly noted

    Rubberman, your comments do make sense and your right no one has taken into account what you have mentioned in your post. Thanks for the insight. I will forward this message on to my counterparts. What I am missing, though, is I need take a users GUI session and pop up a screensaver, after 15 minutes of inactivity, that requires them to login once they resume their session. This is harmless and I know it can be done. I'm just a newbie and don't know how to do it correctly. As you see above, I was hoping the code would work for all users but for some reason it does not. Any ideas how I can perform this in RHEL? Yes, I know how to set screensaver settings by user, but I need to set these settings for all users and maybe root.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,159
    Quote Originally Posted by newbie56 View Post
    Rubberman, your comments do make sense and your right no one has taken into account what you have mentioned in your post. Thanks for the insight. I will forward this message on to my counterparts. What I am missing, though, is I need take a users GUI session and pop up a screensaver, after 15 minutes of inactivity, that requires them to login once they resume their session. This is harmless and I know it can be done. I'm just a newbie and don't know how to do it correctly. As you see above, I was hoping the code would work for all users but for some reason it does not. Any ideas how I can perform this in RHEL? Yes, I know how to set screensaver settings by user, but I need to set these settings for all users and maybe root.
    Enabling a screen saver for a GUI is certainly doable, and won't shut down processes they are running. If someone has logged into a non-gui command line, via ssh or telnet then timing them out after some period of inactivity is not unreasonable, as someone who is running background processes that way should know enough to nohup them in the first place. I think you can signal a text login shell with a SIGHUP after some period of inactivity, which should force the logoff there, but honestly I don't know what the exact mechanism is to do that. I know that finger will show the amount of time a user login session has been idle, so at worst it would be possible for some cron script to grep for users with excessive idle time every so often, and shut the session down. Just do it on a non-critical system first until you have sorted out all the glitches that could get you lynched!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined! newbie56's Avatar
    Join Date
    Jan 2009
    Posts
    36
    I found that you could use a program called "Sabayon" to profile your users GUIs. This way I can set all users' GUI to lock their screen if it is inactive for 15 minutes. I still can't find a way to lock the screen of the root user, though. Anybody have any ideas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •