Linux Hardening Questions Flashcards
Because Linux is more securely designed than Windows, we never have to worry about Linux
security.
a. True
b. False
b. False.
Which of the following is true about Linux on IoT devices?
a. There are too many of them.
b. They’re taking over the world.
c. Too many of them are configured insecurely.
d. They’re so securely configured that they’ll put security practitioners out of their jobs.
c. Too many of them are configured insecurely.
Which of the following is true about automatic operating system updates in an enterprise?
a. You should always leave them enabled.
b. They violate the basic precept of testing updates on a test network before installing
them on a production network.
c. Unlike with manual updates, you never have to reboot a system after automatic updates.
d. For IoT devices, it isn’t useful to enable automatic updates.
b. They violate the basic precept of testing updates on a test network before installing
What is the best way to grant administrative privileges to users?
a. Give every administrative user the root user password.
b. Add each administrative user to either the sudo group or the wheel group.
c. Create sudo rules that only allow administrative users to do tasks that are directly
related to their jobs.
d. Add each administrative user to the sudoers file and grant them full administrative
privileges.
c. Create sudo rules that only allow administrative users to do tasks that are directly
Which of the following is true?
a. When users log in as the root user, all the actions that they perform will be recorded
in the auth.log or the secure log file.
b. When users use sudo, all the actions that they perform will be recorded in the messages
or the syslog file.
c. When users log in as the root user, all the actions that they perform will be recorded
in the messages or the syslog file.
d. When users use sudo, all the actions that they perform will be recorded in the auth.
log or the secure log file.
d. When users use sudo, all the actions that they perform will be recorded in the auth.
log or the secure log file.
Which of the following methods would you use to create sudo rules for other users?
a. Open the /etc/sudoers file in your favorite text editor.
b. Open the /etc/sudoers file with visudo.
c. Add a sudoers file to each user’s home directory.
d. Open the /var/spool/sudoers file with visudo.
b. Open the /etc/sudoers file with visudo.
You need to see a list of network services that are listening for incoming connections. Which
of the following commands would you use?
a. sudo systemctl -t service –state=active
b. netstat -i
c. netstat -lp -A inet
d. sudo systemctl -t service –state=listening
c. netstat -lp -A inet
Which one of the following represents best security practice?
a. Always give the root user password to all users who need to perform administrative tasks.
b. Always give full sudo privileges to all users who need to perform administrative tasks.
c. Always just give specific, limited sudo privileges to all users who need to perform
administrative tasks.
d. Always edit the sudoers file in a normal text editor, such as nano, vim, or emacs.
c. Always just give specific, limited sudo privileges to all users who need to perform
administrative tasks.
Which of the following statements is true?
a. sudo can only be used on Linux.
b. sudo can be used on Linux, Unix, and BSD operating systems.
c. When a user performs a task using sudo, the task does not get recorded in a security log.
d. When using sudo, users must enter the root user password.
b. sudo can be used on Linux, Unix, and BSD operating systems.
You want specific users to edit a specific system configuration file, but you don’t want them to
use a shell escape that would allow them to perform other administrative tasks. Which two of
the following could you do?
a. In the sudoers file, specify that the users can only use vim to open a specific configu-
ration file.
b. In the sudoers file, specify that the users can use sudoedit to edit a specific configu-
ration file.
c. In the sudoers file, specify the no shell escape option for these users.
d. In the sudoers file, place these users into a group that does not have shell escape
privileges.
b. In the sudoers file, specify that the users can use sudoedit to edit a specific configu-
ration file.
Which of the following commands would you use to see only a list of established TCP con-
nections?
a. netstat -p -A inet
b. netstat -lp -A inet
c. sudo systemctl -t service –state=connected
d. sudo systemctl -t service –state=active
a. netstat -p -A inet
When Nmap tells you that a port is in an open state, what does that mean?
a. That the port is open on the firewall.
b. That the port is open on the firewall and that the service that’s associated with that
port is running.
c. That the port is accessible via the Internet.
d. That the port’s Access Control List is set to open.
b. That the port is open on the firewall and that the service that’s associated with that
port is running.
Which of these Nmap scan options would you most likely use to scan for open TCP ports?
a. -sn
b. -sU
c. -sS
d. -sA
c. -sS
How does discovery mode work in Nmap?
a. It discovers network devices by sending ping packets to the network’s broadcast address.
b. It discovers network devices by sending SYN packets to the network’s broadcast address.
c. It sends out ARP packets for a local network and ping packets for a remote network.
d. It sends out ping packets for a local network and ARP packets for a remote network.
c. It sends out ARP packets for a local network and ping packets for a remote network.
What do you want to do when resetting the root user password on a Red Hat/CentOS/AlmaLi-
nux machine?
a. Ensure that AppArmor is in enforcing mode.
b. Ensure that SELinux is in enforcing mode.
c. Ensure that AppArmor is in complain mode.
d. Ensure that SELinux is in permissive mode.
d. Ensure that SELinux is in permissive mode.
You want to use Nmap to perform a UDP port scan of an entire subnet. Which of the following
commands would you use?
a. sudo nmap -sU 192.168.0.0
b. sudo nmap -U 192.168.0.0
c. sudo nmap -U 192.168.0.0/24
d. sudo nmap -sU 192.168.0.0/24
d. sudo nmap -sU 192.168.0.0/24
How would you begin the process of hardening a new computer system?
a. Apply an OpenSCAP profile when installing the operating system.
b. Begin the initial setup by following a checklist.
c. Install the operating system, then apply an OpenSCAP profile.
d. Install the operating system, then follow a hardening checklist.
b. Begin the initial setup by following a checklist.
On a Red Hat/CentOS/AlmaLinux server, what would you most likely do to force users to enter
a password before editing kernel parameters during bootup?
a. Enter the sudo grub2-password command.
b. Hand-edit the grub configuration file.
c. Enter the sudo grub2-setpassword command.
d. Enter the sudo grub-setpassword command.
e. Enter the sudo grub-password command.
c. Enter the sudo grub2-setpassword command.
In which file would you configure complex password criteria?
/etc/security/pwquality.conf
When using the useradd utility on a RHEL 7-type machine, what should the UMASK setting be
in the /etc/login.defs file?
077
When using the adduser utility on an Ubuntu 20.04 machine, how would you configure the
/etc/adduser.conf file so that new users’ home directories will prevent other users from
accessing them?
Change the DIR_MODE= value to DIR_MODE=750
What change did the National Institute for Standards and Technology recently make to its
recommended password policy?
They abandoned their old philosophy about password complexity and password expirations.
Which three of the following utilities can you use to set user account expiry data?
a. Useradd
b. Adduser
c. Usermod
d. chage
a, c, and d
Why might you want to lock out the user account of a former employee, rather than delete it?
a. It’s easier to lock an account than it is to delete it.
b. It takes too long to delete an account.
c. It’s not possible to delete a user account.
d. Deleting a user account, along with the users’ files and mail spool, might get you into
trouble with the law.
d. Deleting a user account, along with the users’ files and mail spool, might get you into
You’ve just created a user account for Samson, and you now want to force him to change his
password the first time he logs in. Which two of the following commands will do that?
a. sudo chage -d 0 samson
b. sudo passwd -d 0 samson
c. sudo chage -e samson
d. sudo passwd -e samson
a and d
Which one of the following is an advantage that the adduser utility has over the traditional
useradd utility?
a. adduser can be used in shell scripts.
b. adduser is available for all Linux distributions.
c. adduser has an option that allows you to encrypt a user’s home directory as you create
the user account.
d. adduser is also available for Unix and BSD.
c. adduser has an option that allows you to encrypt a user’s home directory as you create
the user account.
In the newest Linux distributions, what is the name of the PAM module that you can use to
enforce strong passwords?
a. cracklib
b. passwords
c. Secure
d. pwquality
d. pwquality
Which of the following best describes IPFire?
a. A host-based firewall appliance with a built-in NIDS
b. An edge firewall appliance with a built-in NIDS
b. An edge firewall appliance with a built-in NIDS
Which of the following utilities is best for scanning Sarbanes-Oxley compliance issues?
a. Lynis
b. Lynis Enterprise
c. Greenbone Security Assistant
d. OpenSCAP
b. Lynis Enterprise
Which of the following best represents what Snort is?
a. HIDS
b. GIDS
c. NIDS
d. FIDS
c. NIDS
Which of the following would you use as a general-purpose, external vulnerability scanner?
a. Greenbone Security Assistant
b. Nikto
c. OpenSCAP
d. Lynis
a. Greenbone Security Assistant