CompTIA Linux+ XK0-005 – Question100

A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server.
Which of the following commands will enforce this rule?

A.
iptables -f filter -I INPUT -p tcp –dport 4000:5000 -A ACCEPT
B. iptables -t filter -A INPUT -p tcp –dport 4000:5000 -j ACCEPT
C. iptables filter -A INPUT -p tcp –dport 4000:5000 -D ACCEPT
D. iptables filter -S INPUT -p tcp –dport 4000:5000 -A ACCEPT

Correct Answer: B

CompTIA Linux+ XK0-005 – Question099

A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)

A.
Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.
B. Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.
C. Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.
D. Interrupt the boot process in the GRUB menu and add single=user in the kernel line.
E. Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.
F. Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.

Correct Answer: CE

CompTIA Linux+ XK0-005 – Question098

A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?

A.
docker cp container_id/deployment.yaml deployment.yaml
B. docker cp container_id:/deployment.yaml deployment.yaml
C. docker cp deployment.yaml local://deployment.yaml
D. docker cp container_id/deployment.yaml local://deployment.yaml

Correct Answer: B

CompTIA Linux+ XK0-005 – Question097

A Linux system is getting an error indicating the root filesystem is full. Which of the following commands should be used by the systems administrator to resolve this issue? (Choose three.)

A.
df -h /
B. fdisk -1 /dev/sdb
C. growpart /dev/mapper/rootvg-rootlv
D. pvcreate /dev/sdb
E. lvresize L +10G -r /dev/mapper/rootvg-rootlv
F. lsblk /dev/sda
G. parted -l /dev/mapper/rootvg-rootlv
H. vgextend /dev/rootvg /dev/sdb

Correct Answer: DEH

CompTIA Linux+ XK0-005 – Question096

An administrator installed an application from source into /opt/operations1/ and has received numerous reports that users are not able to access the application without having to use the full path /opt/ operations1/bin/*. Which of the following commands should be used to resolve this issue?

A.
echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile
B. echo 'export PATH=/opt/operations1/bin' >> /etc/profile
C. echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile
D. echo 'export $PATH:/opt/operations1/bin' >> /etc/profile

Correct Answer: A

CompTIA Linux+ XK0-005 – Question094

A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users' access will be disabled once the project is over. The expiration date should be 2021-09-30. Which of the following commands will accomplish this task?

A.
sudo useradd -e 2021-09-30 Project_user
B. sudo useradd -c 2021-09-30 Project_user
C. sudo modinfo -F 2021-09-30 Project_uses
D. sudo useradd -m -d 2021-09-30 Project_user

Correct Answer: A

CompTIA Linux+ XK0-005 – Question093

A junior Linux administrator is tasked with installing an application. The installation guide states the application should only be installed in a run level 5 environment.

Which of the following commands would ensure the server is set to runlevel 5?

A.
systemctl isolate multi-user.target
B. systemctl isolate graphical.target
C. systemctl isolate network.target
D. systemctl isolate basic.target

Correct Answer: B

CompTIA Linux+ XK0-005 – Question092

A systems administrator is tasked with installing GRUB on the legacy MBR of the SATA hard drive. Which of the following commands will help the administrator accomplish this task?

A.
grub-install /dev/hda
B. grub-install /dev/sda
C. grub-install /dev/sr0
D. grub-install /dev/hd0,0

Correct Answer: B

CompTIA Linux+ XK0-005 – Question091

A systems administrator is investigating why one of the servers has stopped connecting to the internet.

Which of the following is causing the issue?

A.
The DNS address has been commented out in the configuration file.
B. The search entry in the /etc/resolv.conf file is incorrect.
C. Wired connection 1 is offline.
D. No default route is defined.

Correct Answer: A