ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 201 - XK0-005 discussion

Report
Export

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?

A.
/sbin/nologin
Answers
A.
/sbin/nologin
B.
/bin/ sh
Answers
B.
/bin/ sh
C.
/sbin/ setenforce
Answers
C.
/sbin/ setenforce
D.
/bin/bash
Answers
D.
/bin/bash
Suggested answer: A

Explanation:

The /sbin/nologin shell is a special shell that prevents the user from logging into an interactive session. It is commonly used for system accounts that are not meant to be accessed by users, such as daemon or service accounts. When a user tries to log in with this shell, they will see a message like ''This account is currently not available'' and the login will fail.

The /sbin/nologin shell is listed as one of the valid shells in the /etc/shells file1.

The CompTIA Linux+ Certification Exam Objectives mention that the candidate should be able to ''configure and manage system accounts and groups, including password aging and restricted shells'' as part of the Hardware and System Configuration domain2.

The usermod command can be used to change the user's login shell with the -s or --shell option3. For example, to change the shell of a user named daemon to /sbin/nologin, the command would be:sudo usermod -s /sbin/nologin daemon

asked 02/10/2024
samuel crook
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first