Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

How do I inactivate an account after 14 days without changing a password?

Discussion in 'General Linux' started by red, Dec 2, 2011.

  1. red

    red Guest

    I am trying to test some new user policies and I would like test this. I just need to know how to set it up so that after 14 days go by without changing your password, your account is permanently disabled.

    This change would apply to all current and new users.
  2. Look at useradd -e
  3. red

    red Guest

    that's for expiring an account after a certain date. I want to set up a new policy that expires accounts that haven't changed their password 14 days after they're supposed to.
  4. Phoenix

    Phoenix Guest

    useradd -f


    check /etc/shadow and on the 3rd field, there's a day count of how many days since Jan. 1, 1970 has come as of today. You can do a bit of math and check the dates the user has registered in a manner to minus it from Jan. 1, 1970. Then add 14 and if the 2nd field hasn't changed, then you could use an if in a cron script.
  5. Victor Leigh

    Victor Leigh Guest

    Just curious. What's the objective of doing this? Wouldn't this shut out a lot of users?
  6. red

    red Guest

    the command I was looking for was chage -I

    The reason for this is that if an account is inactive for that amount of time, without me being notified as to why they're gong that long, I think there's something wrong and I do not want them having access to my systems.

Share This Page