A system administrator is creating a service account that needs to own files for an application but must be prevented from being used for an interactive shell login. When an access attempt occurs, a polite message should be displayed informing the user that the account is unavailable for login. Which shell should the administrator assign to this user in the /etc/passwd file to achieve this specific outcome?
The correct answer is /sbin/nologin. This is a special shell used specifically for accounts that should not have interactive login access, such as service accounts. When a user attempts to log in to an account with this shell, it displays a message like "This account is currently not available." and terminates the session. The /bin/false shell also prevents logins but does so by immediately exiting with a failure status and typically displays no message. /bin/rbash is a restricted shell that allows a login but limits the user's capabilities, which does not meet the requirement to prevent the login itself. /bin/bash is a standard, fully interactive shell and is the opposite of the desired configuration.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of /sbin/nologin?
Open an interactive chat with Bash
Why is /bin/false not appropriate for this scenario?
Open an interactive chat with Bash
What is the difference between /sbin/nologin and /bin/rbash?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access