/etc/passwd File Format in Linux Explained

5800

Full article here

  1. Username field: This field denotes the User (or User Account) Name. According to the man page of useradd command, “Usernames may only be up to 32 characters long”. This username must be used at the time of logging in to the system.
  2. Password field: Second field is the Password field, not denoting the actual password though. A ‘x‘ in this field denotes the password is encrypted and saved in the /etc/shadow file.
  3. UID field: Whenever a new user account is created, it is assigned with a user id or UID (UID for the user ‘mandar‘ is 500, in this case) and this field specifies the same.
  4. GID field: Similar to the UID field, this field specifies which group the user belongs to, the group details being present in /etc/group file.
  5. Comment/Description/User Info field: This field is the short comment/description/information of the user account (For this example, user account ‘mandar‘ belongs to the user Mandar Shinde, hence this comment).
  6. User Home Directory: Whenever a user logs in to the system, he is taken to his Home directory, where all his personal files reside. This field provides the absolute path to the user’s home directory (/home/mandar in this case).
  7. Shell: This field denotes, the user has access to the shell mentioned in this field (user ‘mandar‘ has been given access to /bin/bash or simply bash shell).

Read more on YourOwnLinux