LPIC-2 System Security Practice Question
Which TWO of the following are recommended best practices for securing a Linux server that is publicly accessible?
⚠ Common exam trap
Many candidates think enabling NFS exports (Option D) is a standard file-sharing practice, but on a publicly accessible server, it introduces severe security risks (e.g., no encryption, easy port scanning) and is explicitly discouraged in LPIC-2 security guidelines.
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
✓
Use a firewall to restrict access to only necessary ports.
A firewall (e.g., iptables, nftables, or ufw) restricts inbound traffic to only necessary ports (e.g., 22/TCP for SSH, 80/TCP for HTTP, 443/TCP for HTTPS), reducing the attack surface by blocking unused services. This is a fundamental defense-in-depth practice for publicly accessible servers. Option E is correct because disabling direct root login via SSH (by setting PermitRootLogin no in /etc/ssh/sshd_config) forces users to authenticate with a regular account and then escalate privileges (e.g., via su or sudo), which adds an additional layer of security by preventing brute-force attacks directly against the root account. Options A, B, and D are incorrect: running services with root privileges (A) increases the risk of privilege escalation if a service is compromised; setting simple passwords (B) weakens authentication; and enabling NFS exports (D) on a public server exposes filesystems without adequate encryption or access control, which is a severe security risk.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run all services with root privileges.
Why it's wrong here
Running services as root creates a large attack surface.
- ✗
Set all user passwords to simple, memorable ones.
Why it's wrong here
Weak passwords are easily guessed or cracked.
- ✓
Use a firewall to restrict access to only necessary ports.
Why this is correct
Reduces the attack surface by limiting exposed services.
- ✗
Enable NFS exports for file sharing.
Why it's wrong here
NFS is not secure over the internet without additional encryption.
- ✓
Disable direct root login via SSH.
Why this is correct
Prevents brute-force attacks on the root account.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.