Both files /etc/shadow
and /etc/passwd
seem to be the same, they just report some information about accounts. What is the difference between them?
Both files /etc/shadow
and /etc/passwd
seem to be the same, they just report some information about accounts. What is the difference between them?
Short answer:
passwd
stores general user info andshadow
stores user passwd info.Somewhat longer answer:
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.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.Some interesting extra info: passwd and shadow
From The Linux Documentation Project - 6.6. Linux Password & Shadow File Formats:
/etc/shadow
file stores actual password in encrypted format for user's account with additional properties related to user password i.e. it stores secure user account information. All fields are separated by a colon (:) symbol FOR MORE
/etc/passwd
file stores essential information, which is required during login i.e. user account information. /etc/passwd is a text file, that contains a list of the system's accounts, giving for each account some useful information like user ID, group ID, home directory, shell, etc. FOR MORE