The /etc/passwd file is a plain text-based database that contains information for all user accounts on the system. It is owned by root and has 644 permissions. The file can only be modified by root or users with sudo privileges and readable by all system users. Each line of the /etc/passwd file contains seven comma-separated fields, representing a user account. The fields are as follows:
Username: The string you type when you log into the system. Each username must be a unique string on the machine. The maximum length of the username is restricted to 32 characters.
Password: In older Linux systems, the user’s encrypted password was stored in the /etc/passwd file. On most modern systems, this field is set to x, and the user password is stored in the /etc/shadow file.
User ID (UID): The user identifier is a number assigned to each user by the operating system to refer to a user. It is used by the kernel to check for the user privileges and grant access to system resources. The UID 0 is reserved for the root user and cannot be assigned to any other user.
Group ID (GID): The user’s group identifier number, referring to the user’s primary group. When a user creates a file, the file’s group is set to this group. Typically, the name of the group is the same as the name of the user. User’s secondary groups are listed in the /etc/group file.
User ID Info (GECOS): This is a comment field. This field contains a list of comma-separated values with the following information: User’s full name or the application name, Room number, Work phone number, Home phone number, Other contact information.
Home directory: The absolute path to the user’s home directory. It contains the user’s files and configurations. By default, the user home directories are named after the name of the user and created under the /home directory.
Login shell: The absolute path to the user’s login shell. This is the shell that is started when the user logs into the system. On most Linux distributions, the default login shell is Bash.
Therefore, the correct answers are B, C, and E. The user’s storage space limit (A) is not stored in the /etc/passwd file, but in the /etc/quota file. The encrypted password (D) is not stored in the /etc/passwd file, but in the /etc/shadow file. References:
Linux Essentials Topic 104: The Linux Operating System, section 104.4: Runlevels and Boot Targets.
Linux Essentials Topic 106: Security and File Permissions, section 106.1: Basic security and identifying user types.
Linux Essentials Topic 106: Security and File Permissions, section 106.2: Creating users and groups.
Understanding the /etc/passwd File | Linuxize
Understanding the /etc/passwd File - GeeksforGeeks
passwd(5) - Linux manual page - man7.org
Understanding /etc/passwd file in Linux - DEV Community