You get a bonus - 1 coin for daily activity. Now you have 1 coin

Linux Password Files

Practice



Debian stores user information in password files.


/etc/passwd

The first file is called /etc/passwd; it stores the mapping of the user to a group, their login, the shell to run (bash, for example), UID, etc. (not much), one line per user.

File format:
login:encrypted_password:UID:GID:full_name:home_directory:shell

Where:
UID : Unique ID of the user
GID : Unique ID of the user's primary group

The password field usually contains 'x', which means the encrypted password is not stored here.


/etc/shadow

The actual user passwords are stored in the /etc/shadow file, also one line per user. If the passwd file has an entry for a user with 'x' in place of the password, but the shadow file has no entry for that user, the user is considered invalid.

File format:
login:
encrypted_password:
days_since_last_login:
days_before_password_can_be_changed:
days_after_which_password_MUST_be_changed:
days_before_expiry_when_user_starts_being_warned:
days_after_expiry_until_lockout:
days_since_the_Unix_epoch_when_the_user_was_locked:
reserved


/etc/group

Groups are defined in the /etc/group file. Also - one line per group.

File format:
group_name:password:GID:list_of_users

Users are separated from each other by commas. The password is usually absent.


More details (man)

# man 5 passwd
# man 5 shadow
# man 5 group

These help pages relate specifically to the password and group files.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system