201-210 Flashcards
!/bin/bash
A user created the following script file:
# FILENAME: /home/user/script.sh
echo “hello world”
exit 1
However, when the user tried to run the script file using the command ~/script.sh, an error returned indicating permission was denied. Which of the following should the user execute in order for the script to run properly?
A. chmod u+x /home/user/script.sh
B. chmod 600 /home/user/script.sh
C. chmod 007 /home/user/script.sh
D. chmod o+r /home/user/script.sh
A. chmod u+x /home/user/script.sh
A systems administrator is enabling LUKS on a USB storage device with an ext4 filesystem format. The administrator runs dmesg and notices the following output:
sd 8:0:0:0: [sdc] Attached SCSI disk
EXT4-fs (sdc1): mounting ext3 file system using the ext4 subsystem
EXT4-fs (sdc1): mounted filesystem with ordered data mode. OPTs: (null)
Given this scenario, which of the following should the administrator perform to meet these requirements? (Choose three.)
A. gpg /dev/sdc1
B. pvcreate /dev/sdc
C. mkfs.ext4 /dev/mapper/LUKS0001 - L ENCRYPTED
D. umount /dev/sdc
E. fdisk /dev/sdc
F. mkfs.vfat /dev/mapper/LUKS0001 - L ENCRYPTED
G. wipefs -a/dev/sdb1
H. cryptsetup luksFormat /dev/sdc1
D. umount /dev/sdc
E. fdisk /dev/sdc
H. cryptsetup luksFormat /dev/sdc1
A developer wants to ensure that all files and folders created inside a shared folder named /Group00DEV inherit the group name of the parent folder. Which of the following commands will help achieve this goal?
A. chmod g+x /Group00DEV/
B. chmod g+w /Group00DEV/
C. chmod g+r /Group00DEV/
D. chmod g+s /Group00DEV/
D. chmod g+s /Group00DEV/
Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the ls command. The output displays files that reside in Ann’s home directory instead of Joe’s. Which of the following represents the command Ann should have issued in order to list Joe’s files?
A. su - Joe
B. sudo Joe
C. visudo Joe
D. pkexec Joe
A. su - Joe
A developer needs to launch an Nginx image container, name it Web00l, and expose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?
A. docker exec -it -p 8080:80 –name Web001 nginx
B. docker load -it -p 8080:80 –name Web001 nginx
C. docker run -it -p 8080:80 –name Web001 nginx
D. docker pull -it -p 8080:80 –name Web001 nginx
C. docker run -it -p 8080:80 –name Web001 nginx
The security team has identified a web service that is running with elevated privileges. A Linux administrator is working to change the systemd service file to meet security compliance standards. Given the following output:
[Unit]
Description=CompTIA server daemon
Documentation=man:webserver(8) man:webserver_config(5)
After=network.target -
[Service]
Type=notify -
EnvironmentFile=/etc/webserver/config
ExecStart=/usr/sbin/webserver -D $OPTIONS
ExecReload=/bin/kill -HUP SMAINPID
KillMode=process -
Restart=on-failure -
RestartSec=42s -
[Install]
WantedBy=multi-user.target -
Which of the following remediation steps will prevent the web service from running as a privileged user?
A. Removing the ExecStart=/usr/sbin/webserver -D $OPTIONS from the service file
B. Updating the EnvironmentFile line in the [Service] section to /home/webservice/config
C. Adding the User=webservice to the [Service] section of the service file
D. Changing the multi-user.target in the [Install] section to basic.target
C. Adding the User=webservice to the [Service] section of the service file
A Linux administrator provisioned a new web server with custom administrative permissions for certain users. The administrator receives a report that user1 is unable to restart the Apache web service on this server. The administrator reviews the following output:
[ root@server ] # id user1
UID=1011(user1) gid=1011(USER1) groups=1011(user1), 101(www-data), 1120(webadmin)
[ root@server ] # cat /etc/sudoers.d/custom.conf
user1 ALL=/usr/sbin/systemctl start httpd, /usr/sbin/systemctl stop httpd
webadmin ALL=NOPASSWD: /etc/init.d.httpd restart, /sbin/service httpd restart, /usr/sbin/apache2ctl restart
%wheel ALL=(ALL) NOPASSWD: ALL
Which of the following would most likely resolve the issue while maintaining a least privilege security model?
A. User1 should be added to the wheel group to manage the service.
B. User1 should have “NOPASSWD:” after the “ALL=” in the custom.conf.
C. The wheel line in the custom.conf file should be uncommented.
D. Webadmin should be listed as a group in the custom.conf file.
D. Webadmin should be listed as a group in the custom.conf file.
Which of the following would significantly help to reduce data loss if more than one drive fails at the same time?
A. Server clustering
B. Load balancing
C. RAID
D. VDI
C. RAID
A systems administrator receives reports that several virtual machines in a host are responding slower than expected. Upon further investigation, the administrator obtains the following output from one of the affected systems:
16:00:01|PM|CPU|%user|%nice|%system|%iowait|%steal|%idle
16:10:01|PM|all|17:58|0.00|9.36|0.00|54.33|18.73
16:20:01|PM|all|22.34|0.00|11.75|0.00|48.69|17.22
16:30:01|PM|all|25.49|0.00|11.69|0.00|57.85|4.97
16:40:01|PM|all|25.49|0.00|11.69|0.00|53.21|9.61
16:50:01|PM|all|25.49|0.00|11.69|0.00|56.49|6.33
Which of the following best explains the reported issue?
A. The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.
B. The physical host has enough CPU cores, leading to users running more processes to compensate for the slower response times.
C. The virtual machine has enough CPU cycles, leading to the system use percentage being higher than expected.
D. The virtual machine is running out of CPU resources, leading to users experiencing longer response times.
A. The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.
nslookup server1
A user is unable to remotely log on to a server using the server name server1 and port 22. The Linux engineer troubleshoots the issue and gathers the following information:
Server: 123.1.2.4
Address: 123.1.2.4 #53
Name: server1
Address: 123.1.2.3
sshd.service - Openssh sshd daemon
Loaded: loaded (usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-09-09 12:44:49 CDT; 6 days ago
Main PID: 1900 (sshd)
CGroup: /system.slice/sshd.service
-1900 /usr/share/sbin/sshd -D
tcp 0 0 123.1.2.3:2222 0.0.0.0:* LISTEN 2701/sshd
Which of the following is most likely causing the issue?
A. server1 is not in the DNS.
B. sshd is running on a non-standard port.
C. sshd is not an active service.
D. server1 is using an incorrect IP address.
B. sshd is running on a non-standard port.