- etc/passwd
- file that stores user account information
- is world readable
- /etc/shadow
- file that stores to encrypted password
- only root account can read it
/etc/passwd
the /etc/passwd file contains ’:’ delimitated entries/lines each containing the following information:
marcuschiu:x:1000:1000:marcuschiu,room-number,work-phone,home-phone,other:/home/marcuschiu:/bin/bash
- username
- encrypted password (replaced with ‘x’ since encrypted passwords are stored in the /etc/shadow file
- user ID number (UID)
- user’s group ID number (GID)
- GECOS field is a comma-delimited list with this order:
- user’s full name (or application name, if the account is for a program)
- building and room number or contact person
- office telephone number
- home telephone number
- any other contact information (pager number, fax, external e-mail address, etc.)
- user home directory
- default login shell - for other ways to set it see /etc/passwd - /etc/shadow
/etc/shadow
the /etc/shadow file contains ’:’ delimitated entries/lines each containing the following information:
e:$6$zWJiqc5G$MP7dTXaYfEcTFRXZUv.VypwS7tQVlihjQlDbDxpDideQ641PhM0E49hf5kxw33qCz6bCCIN4JHkyRcur/AEwX/:18216:0:99999:7:::
- Username : It is your login name.
- Password : It is your encrypted password. The password should be minimum 8-12 characters long including special characters, digits, lower case alphabetic and more. Usually password format is set to $id$salt$hashed, The $id is the algorithm used On GNU/Linux as follows:
- $1$ is MD5
- $2a$ is Blowfish
- $2y$ is Blowfish
- $5$ is SHA-256
- $6$ is SHA-512
- Last password change (lastchanged) : Days since Jan 1, 1970 that password was last changed
- Minimum : The minimum number of days required between password changes i.e. the number of days left before the user is allowed to change his/her password
- Maximum : The maximum number of days the password is valid (after that user is forced to change his/her password)
- Warn : The number of days before password is to expire that user is warned that his/her password must be changed
- Inactive : The number of days after password expires that account is disabled
- Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used.