Find the answer to your Linux question:
Results 1 to 7 of 7
Ocassionally, I forget to logout from my system when I go work on something else at home. Is there a way to have the system automatically log me out after ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    4

    Autologout?


    Ocassionally, I forget to logout from my system when I go work on something else at home. Is there a way to have the system automatically log me out after a specified idle time? I see that I can have the screensaver activate and lock the screen, but I don't see an automatic logout setting. Does such a thing exist?


  2. #2
    Linux Engineer
    Join Date
    May 2003
    Location
    Greece / Athens
    Posts
    1,169
    why don't you check man shutdown or man halt commands?maybe there is something there..(i didn't search for that though...)
    Linux For Ever!

  3. #3
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    im sure you could write a simple script that just waits for 2 hours of keyboard inactivity then logsout, but I don't know of any functions that do such a thing. Why would it matter? Linux can break remote connections after a certain idel time, but if you are logged in, and the screenlocks, thats the same as a login prompt.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    4
    Maybe I didn't explain the difference between a screensaver locking the screen and the system logging you out. In the first case, the screen is locked and you enter my password to get into my account (which is not what I want). In the second case, the system logs me out and you have to enter your username and password. The second is what I want so that, if I forget to logout, my wife can come use the system at some point. This is a capability that Windows-NT has. Oh, and shutdown and halt are for doing something system-wide as opposed to my own account.

  6. #5
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    sorry, stuck in my world where I am the only linux user in the home, the script is a relativly simple way.
    if(/dev/<keyboard> && /dev/<mouse> == inactive 3000s)
    logout

    make it a cron job, or something of the like (that is not the actual script, i don't know much bash scripting).

    --or--

    you could jsut utrn off automatic screenlocking, that way you wife can just log you off, but whenever you want to lock the screen you can jsut lock it manualy....
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  7. #6
    Just Joined!
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    4
    Quote Originally Posted by qub333
    sorry, stuck in my world where I am the only linux user in the home, the script is a relativly simple way.

    if(/dev/<keyboard> && /dev/<mouse> == inactive 3000s)
    logout

    make it a cron job, or something of the like (that is not the actual script, i don't know much bash scripting).
    Hmmm. Difficult:

    1. I don't have a /dev/mouse or /dev/keyboard. I know you're trying to say the equivalent device and I should know how to determine that, but I don't see something obvious at the moment. Can you enlighten?
    2. The /dev/<mouse> will report the inactivity time? I don't think the above is the proper way (I can fix the bash script, but I don't think the test is proper) -- is there documentation on this?


    you could jsut utrn off automatic screenlocking, that way you wife can just log you off, but whenever you want to lock the screen you can jsut lock it manualy....
    Well, my wife is relatively computer illiterate, so I want to make sure sharp objects are put away. If I happen to be working on something, I don't want her to mess it up by trying to figure out how to "save" it. I'd rather she just knew that, if there was a login screen on the system, she is free to login and do her thing (usually web browsing).

    Thanks for trying, though.

  8. #7
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    for the bash i will get backt oyou, i use something similar for my seti@home, i just am not at home, and therfore cannot see the script ( I only have it set up for keyboard, but you get the idea) Ill post it here tonight, or mabey 2morrow depending on how late im at work 2day, sorry about the confusion/me not making sense.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

Posting Permissions

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