- A
Set the SU_WHEEL_ONLY variable in /etc/login.defs.
Why wrong: login.defs does not have SU_WHEEL_ONLY; this is a myth.
- B
Modify /etc/shells to include only approved shells.
Why wrong: /etc/shells lists valid shells for chsh, not su.
- C
Configure sudoers to allow only specific users to run su.
Why wrong: sudo can be used to run commands as root, but not to restrict su itself.
- D
Edit the /etc/suauth file to specify allowed users.
Legacy method, still works on some systems.
- E
Add the user to the 'wheel' group and configure pam_wheel.so in /etc/pam.d/su.
Common method to restrict su to wheel group.
Quick Answer
The answer is adding the user to the 'wheel' group and configuring pam_wheel.so in /etc/pam.d/su, along with using the /etc/suauth file. These are valid methods to restrict access to the su command because they enforce authentication controls at the PAM (Pluggable Authentication Modules) layer or through the shadow suite’s direct configuration, ensuring only authorized users can switch to the root account. On the LPIC-2 exam, this topic tests your understanding of Linux security mechanisms for privilege escalation, often appearing in questions about PAM module ordering and group-based restrictions. A common trap is confusing pam_wheel.so with pam_securetty.so, which controls terminal access rather than user authorization. Remember the mnemonic “Wheel for su, Securetty for tty” to keep the distinction clear.
LPIC-2 System Security Practice Question
This LPIC-2 practice question tests your understanding of system security. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Which THREE of the following are valid methods to restrict access to the su command on a Linux system?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Edit the /etc/suauth file to specify allowed users.
Option D is correct because the /etc/suauth file (used by some Linux distributions with the 'su' command from the 'shadow' suite) allows you to specify which users or groups are permitted to use su, providing a direct access control mechanism. Option E is correct because configuring pam_wheel.so in /etc/pam.d/su with the 'wheel' group restricts su access to only members of that group, a standard PAM-based method.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the SU_WHEEL_ONLY variable in /etc/login.defs.
Why it's wrong here
login.defs does not have SU_WHEEL_ONLY; this is a myth.
- ✗
Modify /etc/shells to include only approved shells.
Why it's wrong here
/etc/shells lists valid shells for chsh, not su.
- ✗
Configure sudoers to allow only specific users to run su.
Why it's wrong here
sudo can be used to run commands as root, but not to restrict su itself.
- ✓
Edit the /etc/suauth file to specify allowed users.
Why this is correct
Legacy method, still works on some systems.
Related concept
Read the scenario before looking for a memorised answer.
- ✓
Add the user to the 'wheel' group and configure pam_wheel.so in /etc/pam.d/su.
Why this is correct
Common method to restrict su to wheel group.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
LPI often tests the misconception that /etc/login.defs or /etc/shells can restrict su, when in reality these files serve different purposes (login defaults and shell validation) and are not used for su access control.
Trap categories for this question
Command / output trap
sudo can be used to run commands as root, but not to restrict su itself.
Detailed technical explanation
How to think about this question
The /etc/suauth file uses a format like 'username:allowed_users:denied_users' to control su access at the application level, but it is not universally supported (e.g., Debian/Ubuntu use PAM exclusively). The pam_wheel.so module in /etc/pam.d/su enforces group membership (typically 'wheel') before allowing su, and can be configured with 'deny' or 'trust' options; a common subtlety is that the root user is often exempt from this check unless explicitly configured otherwise.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A security administrator must allow nursing staff to reach a patient records server while blocking access from the guest Wi-Fi VLAN. After applying an extended ACL, traffic is still blocked from nursing workstations. The ACL was applied outbound instead of inbound on the wrong interface. Questions like this test ACL direction and placement rules.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
System Security — study guide chapter
Learn the concepts, then practise the questions
- →
System Security practice questions
Targeted practice on this topic area only
- →
All LPIC-2 questions
511 questions across all exam domains
- →
Linux Professional Institute Certification Level 2 LPIC-2 study guide
Full concept coverage aligned to exam objectives
- →
LPIC-2 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related LPIC-2 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Linux Kernel and System Startup practice questions
Practise LPIC-2 questions linked to Linux Kernel and System Startup.
Block Devices, Filesystems and Advanced Storage practice questions
Practise LPIC-2 questions linked to Block Devices, Filesystems and Advanced Storage.
Advanced Networking Configuration practice questions
Practise LPIC-2 questions linked to Advanced Networking Configuration.
DNS, Web and Mail Services practice questions
Practise LPIC-2 questions linked to DNS, Web and Mail Services.
File Sharing and Samba practice questions
Practise LPIC-2 questions linked to File Sharing and Samba.
System Security practice questions
Practise LPIC-2 questions linked to System Security.
Network Client Management practice questions
Practise LPIC-2 questions linked to Network Client Management.
LPIC-2 fundamentals practice questions
Practise LPIC-2 questions linked to LPIC-2 fundamentals.
LPIC-2 scenario practice questions
Practise LPIC-2 questions linked to LPIC-2 scenario.
LPIC-2 troubleshooting practice questions
Practise LPIC-2 questions linked to LPIC-2 troubleshooting.
Practice this exam
Start a free LPIC-2 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this LPIC-2 question test?
System Security — This question tests System Security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Edit the /etc/suauth file to specify allowed users. — Option D is correct because the /etc/suauth file (used by some Linux distributions with the 'su' command from the 'shadow' suite) allows you to specify which users or groups are permitted to use su, providing a direct access control mechanism. Option E is correct because configuring pam_wheel.so in /etc/pam.d/su with the 'wheel' group restricts su access to only members of that group, a standard PAM-based method.
What should I do if I get this LPIC-2 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more ways this is tested on LPIC-2
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Based on the sshd configuration, user 'charlie' attempts to log in using public key authentication. What will happen?
hard- ✓ A.Login is denied because the DenyUsers directive explicitly blocks charlie.
- B.Login is allowed because PasswordAuthentication is disabled, but public key authentication is enabled.
- C.Login is allowed because AllowUsers includes other users but does not deny charlie.
- D.Login is denied because charlie's IP address is not in the allowed list.
Why A: The DenyUsers directive in sshd_config explicitly blocks the user 'charlie' from logging in, regardless of the authentication method. Since DenyUsers takes precedence over AllowUsers and other authentication settings, public key authentication will still be denied for charlie. The correct answer is A because the directive explicitly denies charlie, overriding any other configuration.
Last reviewed: Jun 30, 2026
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.