tags : Linux

/etc/passwd and /etc/shadow

  • passwd is the file where the user information (like username, user ID, group ID, location of home directory, login shell, …) is stored when a new user is created.
    • Putting the actual password hash in it was, in hindsight, a mistake; this was corrected pretty quickly with /etc/shadow but the file had to stick around with the same name because of all the things that were reading it already.
  • shadow is the file where important information (like an encrypted form of the password of a user, the day the password expires, whether or not the passwd has to be changed, the minimum and maximum time between password changes, …) is stored when a new user is created.