BCE-C712 Linux System Administration

0 of 74 lessons complete (0%)

Managing User Accounts

Shadow File

You don’t have access to this lesson

Please register or sign in to access the course content.

The “shadow file” is a system file found on Unix-like operating systems, including Linux. It is used to store password hashes and related information for user accounts. The shadow file is typically located at /etc/shadow.

Here’s an overview of the fields found in the shadow file:

username:password:last_change:min_change:max_change:warn_days:inactive_days:expire_date:reserved
  1. username: This field contains the username of the user account.
  2. password: Historically, this field used to store the user’s encrypted password. However, on modern Linux systems, the actual password hashes are stored here.
  3. last_change: This field records the date (in days since January 1, 1970) when the password was last changed.
  4. min_change: It specifies the minimum number of days required between password changes.
  5. max_change: This field sets the maximum number of days a password is valid before it must be changed.
  6. warn_days: It is the number of days before password expiration that a user is warned about changing their password.
  7. inactive_days: This sets the number of days after a password expires before an account is locked and made inaccessible.
  8. expire_date: This field defines the date (in days since January 1, 1970) when the account will be locked.
  9. reserved: This field is reserved for future use.

It’s important to note that the shadow file is typically readable only by the superuser (root) to protect the sensitive information it contains. This separation of password information from the more accessible /etc/passwd file enhances the security of user account information.

Modern Linux systems use /etc/shadow for storing password hashes and related information, while older systems may still use a combination of /etc/passwd and /etc/shadow for this purpose.

Remember, as a regular user, you should not directly edit or manipulate the shadow file. Instead, user account management should be performed through the appropriate system commands or utilities, which handle password changes and related tasks securely.