CompTIA Linux+ (XK0-005) — Question 173
A systems administrator is tasked with changing the default shell of a system account in order to disable iterative logins. Which of the following is the BEST option for the administrator to use as the new shell?
Answer options
- A. /sbin/nologin
- B. /bin/sh
- C. /sbin/setenforce
- D. /bin/bash
Correct answer: A
Explanation
/sbin/nologin is the correct choice as it prevents users from logging in interactively, effectively disabling their ability to initiate a session. The other options, such as /bin/sh and /bin/bash, are valid shells that allow users to log in, while /sbin/setenforce is a command for changing SELinux modes and is not a shell.