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.
- In the line:
-
root:my_password:0:0:root:/root:/bin/bash
-
- The field match:
-
login:pwd:iduser:idgroup:homedirectory:shell
-
- /etc/passwd is readable by everyone but the passwords are stored in /etc/shadow, are only readable only under root account. They are encoded with MD5 for better security.