Linux+ CompTIA Linux+ Security and Access Control 3 — Questions and Answers
Question 1: What is the purpose of the /etc/sudoers file?
- Stores encrypted user passwords
- Defines which users can run commands as other users via sudo (Correct answer)
- Lists users allowed to use SSH
- Sets system-wide firewall rules
Correct answer: Defines which users can run commands as other users via sudo
/etc/sudoers specifies which users or groups are permitted to run commands as root or another user via sudo.
Question 2: Which AppArmor command loads a profile in enforce mode?
- aa-disable
- aa-complain
- aa-enforce (Correct answer)
- aa-status
Correct answer: aa-enforce
aa-enforce puts an AppArmor profile into enforce mode, actively blocking policy violations.
Question 3: A Linux system uses iptables. Which command saves the current rules so they persist after reboot on a Debian-based system?
- iptables --save
- iptables-save > /etc/iptables/rules.v4 (Correct answer)
- service iptables save
- systemctl save iptables
Correct answer: iptables-save > /etc/iptables/rules.v4
iptables-save redirects current rules to a file that iptables-persistent reads on boot for rule restoration.
Question 4: Which SSH configuration directive in sshd_config disables password authentication entirely?
- PermitRootLogin no
- PasswordAuthentication no (Correct answer)
- ChallengeResponseAuthentication no
- UsePAM no
Correct answer: PasswordAuthentication no
Setting PasswordAuthentication no in sshd_config forces key-based authentication only, disabling passwords.
Question 5: What does the command 'chattr +i /etc/resolv.conf' accomplish?
- Makes the file executable
- Sets the file immutable so it cannot be modified or deleted (Correct answer)
- Encrypts the file contents
- Grants all users read access to the file
Correct answer: Sets the file immutable so it cannot be modified or deleted
chattr +i sets the immutable attribute, preventing any user including root from modifying or deleting the file without first removing the attribute.
Question 6: Which tool is used to audit system calls made by a process for security analysis on Linux?
- strace (Correct answer)
- auditctl
- lsof
- netstat
Correct answer: strace
strace intercepts and records system calls made by a process, making it useful for security and debugging analysis.
Question 7: In a firewalld environment, which zone is typically assigned to trusted internal network interfaces?
- public
- dmz
- internal (Correct answer)
- external
Correct answer: internal
The 'internal' zone in firewalld is intended for interfaces connected to trusted internal networks with higher trust than the public zone.
What is the purpose of the /etc/sudoers file?