To prevent logins from users other than root while etcnologi - CompTIA Linux + XK0-005

Question

To prevent logins from users other than root while /etc/nologin exists, which PAM module should be used?

Answers
  1. correct
Explanation

Correct Answer: D. pam_nologin.so

The pam_nologin.so module is specifically designed to prevent non-root users from logging in when the /etc/nologin file exists. If this file is present, the module denies login attempts for all users except root and displays the file’s content as a message. This is useful for system maintenance, ensuring only the root user has access while notifying others of the restricted state.

Why other options are incorrect:

  • A. pam_login.so: There is no standard pam_login.so module in typical PAM implementations. This appears to be a distractor or non-existent module and is not used to control login access based on the presence of /etc/nologin.
  • B. pam_access.so: This module controls login access based on user, group, or host through the /etc/security/access.conf file. It doesn’t handle the /etc/nologin mechanism and is more suited for policy-based access control, not maintenance-mode logins.
  • C. pam_logindef.so: This is not a valid PAM module. It may be a confusion with configuration files like login.defs, but such a module does not exist and cannot be used to manage user logins or system maintenance access via /etc/nologin.

Related Courses

Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.

a prepsaret exam featured image
CompTIA Prep

220-1201 - CompTIA A+ Exam Core 1

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

220-1202 - CompTIA A+ Exam Core 2

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA SecurityX CAS-005

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud Essentials+ CLO-002

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Network+ N10-009

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Security+ SY0-701

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Data + DA0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Pentest+

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA CySA+ CSO-003

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA DataSys+ DS0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Tech+ FC0-U71

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud+ CV0-004

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Server+ SK0-005

Start Course Prep

Easy way to pass your test within a week with prepsaret

You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams

View Courses Offered