ExamGecko
Home / CompTIA / XK0-005 / List of questions
Ask Question

CompTIA XK0-005 Practice Test - Questions Answers, Page 16

Add to Whishlist

List of questions

Question 151

Report Export Collapse

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:

CompTIA XK0-005 image Question 151 99792 10022024175436000000

Which of the following remediation steps will prevent the web service from running as a privileged user?

Removing the ExecStarWusr/sbin/webserver -D SOPTIONS from the service file
Removing the ExecStarWusr/sbin/webserver -D SOPTIONS from the service file
Updating the Environment File line in the [Service] section to/home/webservice/config
Updating the Environment File line in the [Service] section to/home/webservice/config
Adding the User-webservice to the [Service] section of the service file
Adding the User-webservice to the [Service] section of the service file
Changing the:nulti-user.target in the [Install] section to basic.target
Changing the:nulti-user.target in the [Install] section to basic.target
Suggested answer: C
Explanation:

The remediation step that will prevent the web service from running as a privileged user is adding the User=webservice to the [Service] section of the service file. The service file is a configuration file that defines the properties and behavior of a systemd service. The systemd is a system and service manager that controls the startup and operation of Linux systems. The service file contains various sections and options that specify how the service should be started, stopped, and managed. The [Service] section defines how the service should be executed and what commands should be run.

The User option specifies the user name or ID that the service should run as. The webservice is the name of the user that the administrator wants to run the web service as. The administrator should add the User=webservice to the [Service] section of the service file, which will prevent the web service from running as a privileged user, such as root, and improve the security of the system. This is the correct remediation step to use to prevent the web service from running as a privileged user. The other options are incorrect because they either do not change the user that the service runs as (removing the ExecStart=/usr/sbin/webserver -D OPTIONS from the service file or updating the EnvironmentFile line in the [Service] section to /home/webservice/config) or do not affect the user that the service runs as (changing the multi-user.target in the [Install] section to basic.target). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing System Services, page 458.

asked 02/10/2024
Bernardo Garcia
49 questions

Question 152

Report Export Collapse

A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?

chmod 775
chmod 775
umask. 002
umask. 002
chactr -Rv
chactr -Rv
chown -cf
chown -cf
Suggested answer: B
Explanation:

The command umask 002 will accomplish the task of reconfiguring the server so that only file owners and group members can modify new files by default. The umask command is a tool for setting the default permissions for new files and directories on Linux systems. The umask value is a four-digit octal number that represents the permissions that are subtracted from the default permissions. The default permissions for files are 666, which means read and write for owner, group, and others. The default permissions for directories are 777, which means read, write, and execute for owner, group, and others. The umask value consists of four digits: the first digit is for special permissions, such as setuid, setgid, and sticky bit; the second digit is for the owner permissions; the third digit is for the group permissions; and the fourth digit is for the others permissions. The umask value can be calculated by subtracting the desired permissions from the default permissions. For example, if the desired permissions for files are 664, which means read and write for owner and group, and read for others, then the umask value is 002, which is 666 - 664. The command umask 002 will set the umask value to 002, which will ensure that only file owners and group members can modify new files by default. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not set the default permissions for new files (chmod 775 or chown -cf) or do not exist (chattr -Rv). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11:

Managing File Permissions and Ownership, page 349.

asked 02/10/2024
Mohammed Meddah
42 questions

Question 153

Report Export Collapse

A Linux administrator needs to connect securely to a remote server in order to install application software. Which of the following commands would allow this connection?

scp "ABC-key.pem" [email protected]
scp "ABC-key.pem" [email protected]
sftp rooteiO.0.0.1
sftp rooteiO.0.0.1
telnet 10.0.0.1 80
telnet 10.0.0.1 80
ssh -i "ABC-key.pem" [email protected]
ssh -i "ABC-key.pem" [email protected]
sftp "ABC-key.pem" [email protected]
sftp "ABC-key.pem" [email protected]
Suggested answer: D
Explanation:

The command ssh -i "ABC-key.pem" [email protected] would allow the administrator to connect securely to the remote server in order to install application software. The ssh command is a tool for establishing secure and encrypted connections between remote systems. The -i option specifies the identity file that contains the private key for key-based authentication. The "ABC-key.pem" is the name of the identity file that contains the private key. The [email protected] is the username and the IP address of the remote server. The command ssh -i "ABC-key.pem" [email protected] will connect to the remote server using the private key and allow the administrator to install application software. This is the correct command to use to connect securely to the remote server. The other options are incorrect because they either do not use key-based authentication (sftp [email protected] or telnet 10.0.0.1 80) or do not use the correct syntax for the command (scp "ABC-key.pem" [email protected] instead of scp -i "ABC-key.pem" [email protected] or sftp "ABC-key.pem" [email protected] instead of sftp -i "ABC-key.pem" [email protected]). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 17: Implementing Basic Security, page 513.

asked 02/10/2024
Jesus Vargas
58 questions

Question 154

Report Export Collapse

A Linux administrator rebooted a server. Users then reported some of their files were missing. After doing some troubleshooting, the administrator found one of the filesystems was missing. The filesystem was not listed in /etc/f stab and might have been mounted manually by someone prior to reboot. Which of the following would prevent this issue from reoccurring in the future?

Sync the mount units.
Sync the mount units.
Mount the filesystem manually.
Mount the filesystem manually.
Create a mount unit and enable it to be started at boot.
Create a mount unit and enable it to be started at boot.
Remount all the missing filesystems
Remount all the missing filesystems
Suggested answer: C
Explanation:

The best way to prevent this issue from reoccurring in the future is to create a mount unit and enable it to be started at boot. A mount unit is a systemd unit that defines how and where a filesystem should be mounted. By creating a mount unit for the missing filesystem and enabling it with systemctl enable, the administrator can ensure that the filesystem will be automatically mounted at boot time, regardless of whether it is listed in /etc/fstab or not. Syncing the mount units will not prevent the issue, as it will only synchronize the state of existing mount units with /etc/fstab, not create new ones. Mounting the filesystem manually will not prevent the issue, as it will only mount the filesystem temporarily, not permanently. Remounting all the missing filesystems will not prevent the issue, as it will only mount the filesystems until the next reboot, not after. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Disk Storage, page 457.

asked 02/10/2024
Geoffrey Vd Molen
45 questions

Question 155

Report Export Collapse

A systems administrator is encountering performance issues. The administrator runs 3 commands with the following output

CompTIA XK0-005 image Question 155 99796 10022024175436000000

The Linux server has the following system properties

CPU: 4 vCPU

Memory: 50GB

Which of the following accurately describes this situation?

The system is under CPU pressure and will require additional vCPUs
The system is under CPU pressure and will require additional vCPUs
The system has been running for over a year and requires a reboot.
The system has been running for over a year and requires a reboot.
Too many users are currently logged in to the system
Too many users are currently logged in to the system
The system requires more memory
The system requires more memory
Suggested answer: A
Explanation:

Based on the output of the image sent by the user, the system is under CPU pressure and will require additional vCPUs. The output shows that there are four processes running upload.sh scripts that are consuming a high percentage of CPU time (99.7%, 99.6%, 99.5%, and 99.4%). The output also shows that the system has only 4 vCPUs, which means that each process is using almost one entire vCPU.

This indicates that the system is struggling to handle the CPU load and may experience performance issues or slowdowns. Adding more vCPUs to the system would help to alleviate the CPU pressure and improve the system performance. The system has not been running for over a year, as the uptime command shows that it has been up for only 1 day, 2 hours, and 13 minutes. The number of users logged in to the system is not relevant to the performance issue, as they are not consuming significant CPU resources. The system does not require more memory, as the free command shows that it has plenty of available memory (49 GB total, 48 GB free). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Memory and Process Execution, pages 468-469.

asked 02/10/2024
Ghalem benhameurlaine
37 questions

Question 156

Report Export Collapse

A Linux administrator has logged in to a server for the first time and needs to know which services are allowed through the firewall. Which of the following options will return the results for which the administrator is looking?

firewall-cmd -get-services
firewall-cmd -get-services
firewall-cmd -check-config
firewall-cmd -check-config
firewall-cmd -list-services
firewall-cmd -list-services
systemctl status firewalld
systemctl status firewalld
Suggested answer: C
Explanation:

The firewall-cmd --list-services command will return the results for which the administrator is looking. This command will list all services that are allowed through the firewall in the default zone or a specified zone. A service is a predefined set of ports and protocols that can be enabled or disabled by firewalld. The firewall-cmd --get-services command will list all available services that are supported by firewalld, not only those that are allowed through the firewall. The firewall-cmd --check-config command will check if firewalld configuration files are valid, not list services. The systemctl status firewalld command will display information about the firewalld service unit, such as its state, PID, memory usage, and logs, not list services. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 543.

asked 02/10/2024
Hairul Isman Abdul Gaffar
43 questions

Question 157

Report Export Collapse

While inspecting a recently compromised Linux system, the administrator identified a number of processes that should not have been running:

CompTIA XK0-005 image Question 157 99798 10022024175436000000

Which of the following commands should the administrator use to terminate all of the identified processes?

pkill -9 -f "upload*.sh"
pkill -9 -f "upload*.sh"
kill -9 "upload*.sh"
kill -9 "upload*.sh"
killall -9 -upload*.sh"
killall -9 -upload*.sh"
skill -9 "upload*.sh"
skill -9 "upload*.sh"
Suggested answer: A
Explanation:

The pkill -9 -f "upload*.sh" command will terminate all of the identified processes. This command will send a SIGKILL signal (-9) to all processes whose full command line matches the pattern "upload*.sh" (-f). This signal will force the processes to terminate immediately without giving them a chance to clean up or save their state. The kill -9 "upload*.sh" command is invalid, as kill requires a process ID (PID), not a pattern. The killall -9 "upload*.sh" command is incorrect, as killall requires an exact process name, not a pattern. The skill -9 "upload*.sh" command is incorrect, as skill requires a username or a session ID (SID), not a pattern. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Memory and Process Execution, page 470.

asked 02/10/2024
Ramakrishnan Subramanian
39 questions

Question 158

Report Export Collapse

Which of the following commands is used to configure the default permissions for new files?

setenforce
setenforce
sudo
sudo
umask
umask
chmod
chmod
Suggested answer: C
Explanation:

The command that is used to configure the default permissions for new files is umask.

The umask command is a tool for setting the default permissions for new files and directories on Linux systems. The umask value is a four-digit octal number that represents the permissions that are subtracted from the default permissions. The default permissions for files are 666, which means read and write for owner, group, and others. The default permissions for directories are 777, which means read, write, and execute for owner, group, and others. The umask value consists of four digits: the first digit is for special permissions, such as setuid, setgid, and sticky bit; the second digit is for the owner permissions; the third digit is for the group permissions; and the fourth digit is for the others permissions. The umask value can be calculated by subtracting the desired permissions from the default permissions. For example, if the desired permissions for files are 664, which means read and write for owner and group, and read for others, then the umask value is 002, which is 666 - 664. The command umask 002 will set the umask value to 002, which will ensure that only file owners and group members can modify new files by default. The command that is used to configure the default permissions for new files is umask. This is the correct answer to the question. The other options are incorrect because they either do not set the default permissions for new files (setenforce, sudo, or chmod) or do not exist (kill -HUP or kill -TERM). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, page 349.

asked 02/10/2024
Gopakumar Nair
47 questions

Question 159

Report Export Collapse

During a security scan, the password of an SSH key file appeared to be too weak and was cracked.

Which of the following commands would allow a user to choose a stronger password and set it on the existing SSH key file?

passwd
passwd
ssh
ssh
ssh-keygen
ssh-keygen
pwgen
pwgen
Suggested answer: C
Explanation:

The command that would allow a user to choose a stronger password and set it on the existing SSH key file is ssh-keygen -p -f <keyfile>. This command uses the ssh-keygen tool, which is used to generate, manage, and convert authentication keys for SSH. The -p option stands for passphrase, and it allows the user to change or remove the passphrase of an existing private key file. The -f option specifies the filename of the key file. The command will prompt the user for the old passphrase, and then for the new passphrase twice.

The other options are not correct commands for changing the password of an SSH key file. The passwd command is used to change the password of a user account on a Linux system, not an SSH key file. The ssh command is used to log in to a remote system using SSH, not to change the password of an SSH key file. The pwgen command is used to generate random passwords, not to change the password of an SSH key file.

Reference: ssh-keygen(1) - Linux manual page; How To: Change Passphrase for SSH Private Key - Unix Tutorial

asked 02/10/2024
Franklin Leon
46 questions

Question 160

Report Export Collapse

A Linux systems administrator is troubleshooting an I/O latency on a single CPU server. The administrator runs a top command and receives the following output:

%Cpu(s): 0.2 us, 33.1 sy, 0.0 ni, 0.0 id, 52.4 wa, 0.0 hi, 0.2 si, 0.0 st

Which of the following is correct based on the output received from the executed command?

The server's CPU is taking too long to process users' requests.
The server's CPU is taking too long to process users' requests.
The server's CPU shows a high idle-time value.
The server's CPU shows a high idle-time value.
The server's CPU is spending too much time waiting for data inputs.
The server's CPU is spending too much time waiting for data inputs.
The server's CPU value for the time spent on system processes is low.
The server's CPU value for the time spent on system processes is low.
Suggested answer: C
Explanation:

The server's CPU is spending too much time waiting for data inputs. This can be inferred from the output of the top command, which shows the percentage of CPU time spent in different states. The wa state stands for wait, and it indicates that the CPU is idle while waiting for an I/O operation to complete. In this case, the wa state is 52.4%, which means that more than half of the CPU time is wasted on waiting for data inputs. This can cause a high I/O latency and affect the performance of the server.

The other options are not correct based on the output received from the executed command. The server's CPU is not taking too long to process users' requests, because the us state, which stands for user, is only 0.2%, which means that the CPU is barely used by user processes. The server's CPU does not show a high idle-time value, because the id state, which stands for idle, is 0.0%, which means that the CPU is not idle at all. The server's CPU value for the time spent on system processes is not low, because the sy state, which stands for system, is 33.1%, which means that the CPU is heavily used by system processes.

Reference: How to Use the Linux top Command (and Understand Its Output); [Understanding Linux CPU Load - when should you be worried?]

asked 02/10/2024
Tamas Szekely
39 questions
Total 407 questions
Go to page: of 41
Search

Related questions