The question is all in the title, but I'll repeat it here.

Is it possible to get the date of the last time a password was updated for a user account in macOS? If so, how?

Ideally this would be via a command line tool so I could script these queries and take action when a certain amount of time had passed. If there is a way to check whether or not a particular account's password has expired, that would be just as good.

  • Why do you need to take action if a password is old?
    – mmmmmm
    Commented Aug 30, 2019 at 10:27
  • @Mark - authentication regimes on managed systems going back to the days of mainframe computers have always had a method of recording this data and making it available for administrative purposes. Where I work, we are forced to change our passphrase every year.
    – IconDaemon
    Commented Aug 30, 2019 at 10:56
  • And modern security now says that is a bad thing to force change of passwords
    – mmmmmm
    Commented Aug 30, 2019 at 16:02
  • @Mark - I'm trying to set up a system that issues temporary passwords until a public key is uploaded via ssh-copy-id. Then it disables password auth remotely and lets a user set their own password with no expiry. I just don't want the same password sitting on an account forever. Commented Aug 30, 2019 at 17:46
  • You could check last change date with sudo ls -l /var/db/dslocal/nodes/Default/users/. The whatever_username.plist contains (amongst other things) the account password (encrypted) so changing it updates last change date for the file. Other profile changes may update it too though so it isn't perfect but if last change date for the .plist is over a year then last password change date must be too.
    – lx07
    Commented Aug 31, 2019 at 20:48


You must log in to answer this question.

Browse other questions tagged .