+1 vote
in Linux by
Explain all the fields in the/etc/passwd file?

1 Answer

0 votes
by

/etc/passwd file contains the useful information for all the system users who log in. We have many fields in /etc/passwd file such as username, password, user ID, group ID, comment or user ID info, home directory, command /shell, etc. So, this file contains sensitive information regarding all the user accounts. There is a single line per user in this file. Colon (:) separates the fields in /etc/passwd. Below is the explanation of the fields.

  • Username: First field is the username that contains the username which is 1 to 32 length characters.
  • Password: This field does not show the actual password as the password is encrypted. Here, x character shows that password is encrypted that is located in /etc/shadow file.
  • User ID (UID): All the users created in Linux is given a user ID whenever the user is created. UID 0 is fixed and reserved for the root user.
  • Group ID (GID): This field specifies the name of the group to which the user belongs. The group information is also stored in a file /etc/group.
  • User ID Info: Here you can add comments and you can add any extra information related to the users like full name, contact number, etc.
  • Home directory: This field provides the path where the user is directed after the login. For example, /home/smith.
  • Command/shell: This field provides the path of a command/shell and denotes that user has access to this shell i.e. /bin/bash.

Related questions

+1 vote
asked May 11, 2021 in Linux by rajeshsharma
0 votes
asked Jul 5, 2022 in Linux by sharadyadav1986
...