Polls

Topics

How do you disconnect inactive user sessions?

Posted by Vivek on Friday July 6, 07 @4:12 am

One of our regular reader hall sends an interesting question:

I work for a small company and most user login to centralized Linux server. I’d like to
automatically log out all inactive users from server for various reasons. How do I disconnect inactive user sessions?

To be frank, I don’t have any clear cut answer to question. There are at least 4-5 shells installed on a typical Linux installation. Also most user have has control over their own environment and user can switch to a different shell.

I hope our reader or seasoned UNIX admin can help to answer this question. Please share the experiences and advice in the comments.

Update: Checkout answer below in comments!

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in...

Discussion on This Article:

  1. Oded Maimon Says:

    you can do this in sshd_config file:

    Set idle session timeout to 15 min:
    ClientAliveInterval 300
    ClientAliveCountMax 3

  2. BOK Says:

    Another way: for bash and Korn-shell, setting
    TMOUT=7200
    in /etc/profile will logout users after 2 hours of inactivity.

  3. dave Says:

    Hey I just added three of your articles to fsdaily.com which is a site like digg but for news and article about free software.

    Can you please add an “FSD it” link to your list of service links? It’ll make it easier for me (or anyone else) to do it with future articles you write.

    The link for this article would be:

    URL

    Thanks.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , ~ Last updated on: July 11, 2007

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.