Difficulty: Easy
Correct Answer: shell
Explanation:
Introduction / Context:
The /etc/passwd file contains core details for user accounts on UNIX-like systems. Each record is colon-separated and historically included the hashed password (now typically shadowed). Administrators and developers should know what each field means to troubleshoot logins, shells, and user environments.
Given Data / Assumptions:
Concept / Approach:
Count fields from left to right and map them to their roles. The 7th field is the user's login shell—such as /bin/bash, /bin/sh, /usr/sbin/nologin—defining the program invoked at login or when spawning an interactive session.
Step-by-Step Solution:
Verification / Alternative check:
Use getent passwd username to view the entry. The last colon-separated field will show the shell path (for example, /bin/bash).
Why Other Options Are Wrong:
a: The password hash is not the 7th field and is usually in /etc/shadow.
b: The login (username) is the 1st field.
d: Home directory is the 6th field, not the 7th.
e: Not applicable because the 7th field is the shell.
Common Pitfalls:
Confusing home and shell positions; assuming the password is still stored in /etc/passwd rather than shadowed; overlooking accounts that use a non-interactive shell for service users.
Final Answer:
shell
Discussion & Comments