LPIC-1 Exam 102 v5 (Linux Administrator) — Question 5
Which of the following steps prevents a user from obtaining an interactive login session?
Answer options
- A. Setting the UID for the user to 0.
- B. Running the command chsh -s /bin/false with the user name.
- C. Removing the user from the group staff.
- D. Adding the user to /etc/noaccess.
- E. Creating a .nologin file in the user's home directory.
Correct answer: B
Explanation
The correct answer is B because running the command chsh -s /bin/false changes the user's shell to /bin/false, effectively preventing interactive logins. Option A is incorrect since setting the UID to 0 grants administrative privileges, not restricts access. Options C and D do not prevent login sessions, and option E, while it may prevent login, is not the most direct method compared to option B.