LPI 102-500 Practice Test 17
Question 160
While verifying a Linux change request, an engineer finds: An operator creates a service user's home under /root by hand rather than using appropriate account creation and ownership settings. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Assume a /etc/passwd entry guarantees a populated writable home and that manually adding a directory under /root is a sound default for ordinary users.
- Choose the appropriate LANG and LC_* settings and use LC_ALL=C only where a predictable locale-independent parsing environment is needed.
- Inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell.
- Review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records.
- Create the intended user with a suitable home directory, shell and UID policy using useradd with the needed options, and verify ownership and skeleton-file deployment.
Explanation
Correct Answers
C:Most direct verification evidence: Inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell. Linux principle: A user database entry and a filesystem home directory are separate artifacts; account creation options and distribution defaults govern whether the home exists.
E:Recommended administrative action: Create the intended user with a suitable home directory, shell and UID policy using useradd with the needed options, and verify ownership and skeleton-file deployment. Linux principle: A user database entry and a filesystem home directory are separate artifacts; account creation options and distribution defaults govern whether the home exists.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Assume a /etc/passwd entry guarantees a populated writable home and that manually adding a directory under /root is a sound default for ordinary users. A user database entry and a filesystem home directory are separate artifacts; account creation options and distribution defaults govern whether the home exists.
B:That option would choose the appropriate LANG and LC_* settings and use LC_ALL=C only where a predictable locale-independent parsing environment is needed, but it addresses a different concern. A user database entry and a filesystem home directory are separate artifacts; account creation options and distribution defaults govern whether the home exists.
D:This alternative addresses Account locking suspension and safe removal, not the specific issue of Creating users and provisioning home directories: Review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records. Linux principle: A user database entry and a filesystem home directory are separate artifacts; account creation options and distribution defaults govern whether the home exists.
Question 161
A Linux administrator investigates the following system incident: An administrator finds a password hash in /etc/shadow but attempts to modify it by manually editing /etc/passwd and corrupts account metadata. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Apply the appropriate account lock or expiration, disable alternate authentication paths when needed, then remove the user and files only under approved retention policy.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Use five time fields followed by a command in a user crontab, and include the user field only in the appropriate system crontab or /etc/cron.d format.
- Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
Explanation
Correct Answer
D:Recommended administrative action: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
A:That option would apply the appropriate account lock or expiration, disable alternate authentication paths when needed, then remove the user and files only under approved retention policy, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
B:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. It cannot establish a safe correction. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
C:This alternative addresses User crontab versus system crontab fields, not the specific issue of Shadow password entries and password aging: Use five time fields followed by a command in a user crontab, and include the user field only in the appropriate system crontab or /etc/cron.d format. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
Question 162
On a production Linux workstation or server, a technician observes: An administrator finds a password hash in /etc/shadow but attempts to modify it by manually editing /etc/passwd and corrupts account metadata. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Primary GID and supplementary groups serve distinct access and ownership roles; setting a replacement `-G` list without `-a` removes omitted supplementary memberships.
- Name Service Switch may combine local passwd, group and directory sources; local text files do not necessarily describe all recognized accounts.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Explanation
Correct Answer
D:Relevant Linux operating principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
A:This alternative addresses Supplementary group membership and primary GID, not the specific issue of Shadow password entries and password aging: Primary GID and supplementary groups serve distinct access and ownership roles; setting a replacement `-G` list without `-a` removes omitted supplementary memberships. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
B:This alternative addresses Name service lookups and account database integrity, not the specific issue of Shadow password entries and password aging: Name Service Switch may combine local passwd, group and directory sources; local text files do not necessarily describe all recognized accounts. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
C:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Question 163
During an LPIC-1 practice lab, the operator encounters this condition: An administrator finds a password hash in /etc/shadow but attempts to modify it by manually editing /etc/passwd and corrupts account metadata. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Inspect the at queue and service status, verify the planned timestamp and run a safe one-time test.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Inspect the actual allow and deny files, check mode and ownership, and attempt harmless submissions as an allowed and a denied test account.
- Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login.
Explanation
Correct Answer
D:Most direct verification evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
A:That option would inspect the at queue and service status, verify the planned timestamp and run a safe one-time test, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
B:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:That option would inspect the actual allow and deny files, check mode and ownership, and attempt harmless submissions as an allowed and a denied test account, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Question 164
A helpdesk escalation describes this Linux behavior: An administrator finds a password hash in /etc/shadow but attempts to modify it by manually editing /etc/passwd and corrupts account metadata. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
- The correct user or group is resolved consistently by standard system libraries, with no accidental duplicate identities.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Automation produces stable expected output while interactive users retain their required localization where supported.
Explanation
Correct Answer
A:Observable acceptance criterion: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
B:This alternative addresses Name service lookups and account database integrity, not the specific issue of Shadow password entries and password aging: The correct user or group is resolved consistently by standard system libraries, with no accidental duplicate identities. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
C:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. It cannot establish a safe correction. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
D:This alternative addresses Locale category precedence and stable parsing, not the specific issue of Shadow password entries and password aging: Automation produces stable expected output while interactive users retain their required localization where supported.
Question 165
An operations handoff identifies this problem: An administrator finds a password hash in /etc/shadow but attempts to modify it by manually editing /etc/passwd and corrupts account metadata. Which misleading assumption MOST directly contributes to this failure and should be rejected? Select ONE best answer.
- Assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Assume a /etc/passwd entry guarantees a populated writable home and that manually adding a directory under /root is a sound default for ordinary users.
- Assume LANG always takes priority over LC_ALL and that decimal notation or collation are identical in every locale.
Explanation
Correct Answer
B:Reject this specific misconception: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. It incorrectly assumes behavior that conflicts with the observed Linux conditions.
Incorrect Answers
A:That option would assume cron automatically sources every user's interactive ~/.bashrc and inherits the login terminal's exported desktop variables, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:That option would assume a /etc/passwd entry guarantees a populated writable home and that manually adding a directory under /root is a sound default for ordinary users, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
D:That option would assume LANG always takes priority over LC_ALL and that decimal notation or collation are identical in every locale, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Question 166
A team maintaining a Linux host reports: A compliance baseline requires a user to change their password at a defined interval, yet the operator sets only the directory's filesystem expiration date. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
- Use `getent` and supported user or group administration tools to inspect the effective NSS account database without assuming all identities exist in local files.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Apply the appropriate account lock or expiration, disable alternate authentication paths when needed, then remove the user and files only under approved retention policy.
Explanation
Correct Answer
A:Recommended administrative action: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
Incorrect Answers
B:That option would use `getent` and supported user or group administration tools to inspect the effective NSS account database without assuming all identities exist in local files, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. It cannot establish a safe correction. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
D:This alternative addresses Account locking suspension and safe removal, not the specific issue of Shadow password entries and password aging: Apply the appropriate account lock or expiration, disable alternate authentication paths when needed, then remove the user and files only under approved retention policy.
Question 167
While verifying a Linux change request, an engineer finds: A compliance baseline requires a user to change their password at a defined interval, yet the operator sets only the directory's filesystem expiration date. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- The at daemon queues single-run jobs for specified times, while cron describes recurring schedules, and each queue entry has a removable job ID.
- Primary GID and supplementary groups serve distinct access and ownership roles; setting a replacement `-G` list without `-a` removes omitted supplementary memberships.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Explanation
Correct Answer
D:Relevant Linux operating principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
A:This alternative addresses One-time at jobs and queue management, not the specific issue of Shadow password entries and password aging: The at daemon queues single-run jobs for specified times, while cron describes recurring schedules, and each queue entry has a removable job ID. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
B:This alternative addresses Supplementary group membership and primary GID, not the specific issue of Shadow password entries and password aging: Primary GID and supplementary groups serve distinct access and ownership roles; setting a replacement `-G` list without `-a` removes omitted supplementary memberships. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
C:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Question 168
A Linux administrator investigates the following system incident: A compliance baseline requires a user to change their password at a defined interval, yet the operator sets only the directory's filesystem expiration date. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login.
- Run `locale`, inspect LANG and LC_* values, compare representative command output under LC_ALL=C, and test number and sort handling.
- Review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records.
Explanation
Correct Answer
B:Most direct verification evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. It cannot establish a safe correction. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:That option would run `locale`, inspect LANG and LC_* values, compare representative command output under LC_ALL=C, and test number and sort handling, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
D:That option would review passwd status, chage or usermod lock fields, SSH key access, active sessions and retention or account-removal records, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Question 169
On a production Linux workstation or server, a technician observes: A compliance baseline requires a user to change their password at a defined interval, yet the operator sets only the directory's filesystem expiration date. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
- The correct user or group is resolved consistently by standard system libraries, with no accidental duplicate identities.
- The account has the additional authorized membership while every existing required supplementary group remains intact.
Explanation
Correct Answer
A:Observable acceptance criterion: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
Incorrect Answers
B:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:This alternative addresses Name service lookups and account database integrity, not the specific issue of Shadow password entries and password aging: The correct user or group is resolved consistently by standard system libraries, with no accidental duplicate identities. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
D:This alternative addresses Supplementary group membership and primary GID, not the specific issue of Shadow password entries and password aging: The account has the additional authorized membership while every existing required supplementary group remains intact. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
Question 170
During an LPIC-1 practice lab, the operator encounters this condition: A compliance baseline requires a user to change their password at a defined interval, yet the operator sets only the directory's filesystem expiration date. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell.
- Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access.
- Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login.
- Define a suitable .timer with OnCalendar and Persistent when missed calendar activations should run after downtime, and enable the timer unit rather than only the service.
- Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration.
Explanation
Correct Answers
B:Recommended administrative action: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
C:Most direct verification evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
Incorrect Answers
A:That option would inspect getent passwd for the account, stat the home directory and review useradd defaults, ownership and login shell, but it addresses a different concern. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.
D:This alternative addresses Systemd timers and persistent missed schedules, not the specific issue of Shadow password entries and password aging: Define a suitable .timer with OnCalendar and Persistent when missed calendar activations should run after downtime, and enable the timer unit rather than only the service. Linux principle: /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems. Appropriate response: Use passwd and chage to update password or aging policy through supported account tools, preserving restricted shadow-file access. Root-cause evidence: Inspect `getent passwd`, controlled `chage -l` output, shadow permissions and test behavior at the next authorized login. Independent acceptance: The password is updated or expiration policy enforced as approved while shadow hashes remain inaccessible to unprivileged users.
E:This shortcut is unsafe for the present Linux issue: Edit /etc/passwd as if it contained the shadow password hash and assume a file timestamp changes account password expiration. /etc/passwd stores user identity and shell information, while protected password hashes and aging fields reside in /etc/shadow on shadow-password systems.