ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:

The administrator runs grep db.example.com /etc/hosts and receives the following output:

Given this scenario, which of the following should the administrator do to address this issue?

A.
Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.
A.
Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.
Answers
B.
Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.
B.
Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.
Answers
C.
Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.
C.
Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.
Answers
D.
Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.
D.
Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.
Answers
Suggested answer: D

Explanation:

The administrator should modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88 to address the issue. The /etc/hosts file is a file that maps hostnames to IP addresses on Linux systems. The file can be used to override the DNS resolution and provide a local lookup for hostnames. The dig output shows that the DNS returns the IP address 192.168.20.88 for the hostname db.example.com, which is the correct IP address of the system. The grep output shows that the /etc/hosts file contains an entry for db.example.com with the IP address 192.168.20.89, which is the wrong IP address of the system. This can cause a conflict and prevent the system from being accessed by the hostname. The administrator should modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88, which is the correct IP address of the system. This will align the /etc/hosts file with the DNS and allow the system to be accessed by the hostname. The administrator should modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88 to address the issue. This is the correct answer to the question. The other options are incorrect because they either do not modify the /etc/hosts file (modify the /etc/network file and change the db.example.com entry to 192.168.20.88 or modify the /etc/network file and change the db.example.com entry to 192.168.20.89) or do not change the IP address to the correct one (modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 378.

Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:

Based on the information above, which of the following is causing the issue?

A.
The name www.comptia.org does not point to a valid IP address.
A.
The name www.comptia.org does not point to a valid IP address.
Answers
B.
The server 192.168.168.53 is unreachable.
B.
The server 192.168.168.53 is unreachable.
Answers
C.
No default route is set on the server.
C.
No default route is set on the server.
Answers
D.
The network interface eth0 is disconnected.
D.
The network interface eth0 is disconnected.
Answers
Suggested answer: B

Explanation:

The issue is caused by the server 192.168.168.53 being unreachable. This server is the DNS server configured in the /etc/resolv.conf file, which is used to resolve domain names to IP addresses. The ping command shows that the server cannot be reached, and the nslookup command shows that the name www.comptia.org cannot be resolved using this server. The other options are incorrect because:

The name www.comptia.org does point to a valid IP address, as shown by the nslookup command using another DNS server (8.8.8.8).

The default route is set on the server, as shown by the ip route command, which shows a default gateway of 192.168.168.1.

The network interface eth0 is connected, as shown by the ip link command, which shows a state of UP for eth0. Reference: CompTIA Linux+ Study Guide, Fourth Edition, page 457-458, 461-462.

A systems technician is working on deploying several microservices to various RPM-based systems, some of which could run up to two hours. Which of the following commands will allow the technician to execute those services and continue deploying other microservices within the same terminal section?

A.
gedit & disown
A.
gedit & disown
Answers
B.
kill 9 %1
B.
kill 9 %1
Answers
C.
fg %1
C.
fg %1
Answers
D.
bg %1 job name
D.
bg %1 job name
Answers
Suggested answer: D

Explanation:

The command that will allow the technician to execute the services and continue deploying other microservices within the same terminal session is bg %1 job name. This command will send the job with ID 1 and name job name to the background, where it will run without occupying the terminal.

The other options are incorrect because:

gedit & disown will launch a graphical text editor in the background and detach it from the terminal, but it will not execute any service.

kill 9 %1 will terminate the job with ID 1 using a SIGKILL signal, which cannot be ignored or handled by the process.

fg %1 will bring the job with ID 1 to the foreground, where it will occupy the terminal until it finishes or is stopped. Reference: CompTIA Linux+ Study Guide, Fourth Edition, page 181-182.

A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:

Given there is a single CPU in the sever, which of the following is causing the slowness?

A.
The system is running out of swap space.
A.
The system is running out of swap space.
Answers
B.
The CPU is overloaded.
B.
The CPU is overloaded.
Answers
C.
The memory is exhausted.
C.
The memory is exhausted.
Answers
D.
The processes are paging.
D.
The processes are paging.
Answers
Suggested answer: B

Explanation:

The slowness is caused by the CPU being overloaded. The iostat command shows that the CPU utilization is 100%, which means that there are more processes competing for CPU time than the CPU can handle. The other options are incorrect because:

The system is not running out of swap space, as shown by the iostat command, which shows that there is no swap activity (si and so columns are zero).

The memory is not exhausted, as shown by the free -m command, which shows that there is still available memory (avail column) and free buffer/cache memory (buff/cache column).

The processes are not paging, as shown by the vmstat command, which shows that there are no major page faults (majflt column) and no swap activity (si and so columns). Reference: CompTIA Linux+ Study Guide, Fourth Edition, page 417-419, 424-425.

Employees in the finance department are having trouble accessing the file /opt/work/file. All IT employees can read and write the file. Systems administrator reviews the following output:

Which of the following commands would permanently fix the access issue while limiting access to IT and finance department employees?

A.
chattr +i file
A.
chattr +i file
Answers
B.
chown it:finance file
B.
chown it:finance file
Answers
C.
chmod 666 file
C.
chmod 666 file
Answers
D.
setfacl -m g:finance:rw file
D.
setfacl -m g:finance:rw file
Answers
Suggested answer: D

Explanation:

The command setfacl -m g:finance:rw file will permanently fix the access issue while limiting access to IT and finance department employees. The setfacl command is a tool for modifying the access control lists (ACLs) of files and directories on Linux systems. The ACLs are a mechanism that allows more fine-grained control over the permissions of files and directories than the traditional ownergroup-others model. The -m option specifies the modification to the ACL. The g:finance:rw means that the group named finance will have read and write permissions on the file. The file is the name of the file to modify, in this case /opt/work/file. The command setfacl -m g:finance:rw file will add an entry to the ACL of the file that will grant read and write access to the finance group. This will fix the access issue and allow the finance employees to access the file. The command will also preserve the existing permissions of the file, which means that the IT employees will still have read and write access to the file. This will limit the access to IT and finance department employees and prevent unauthorized access from other users. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not fix the access issue (chattr +i file or chown it:finance file) or do not limit the access to IT and finance department employees (chmod 666 file). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, page 352.

A Linux engineer needs to create a custom script, cleanup.sh, to run at boot as part of the system services. Which of the following processes would accomplish this task?

A.
Create a unit file in the /etc/default/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
A.
Create a unit file in the /etc/default/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
Answers
B.
Create a unit file in the /etc/ske1/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
B.
Create a unit file in the /etc/ske1/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
Answers
C.
Create a unit file in the /etc/systemd/system/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
C.
Create a unit file in the /etc/systemd/system/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
Answers
D.
Create a unit file in the /etc/sysctl.d/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
D.
Create a unit file in the /etc/sysctl.d/ directory.systemctl enable cleanupsystemctl is-enabled cleanup
Answers
Suggested answer: C

Explanation:

The process that will accomplish the task of creating a custom script to run at boot as part of the system services is:

Create a unit file in the /etc/systemd/system/ directory. A unit 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 /etc/systemd/system/ directory is the location where the administrator can create and store custom unit files. The unit file should have a name that matches the name of the script, such as cleanup.service, and should contain the following sections and options:

[Unit]: This section provides the general information about the service, such as the description, dependencies, and conditions. The administrator should specify the following options in this section:

Description: A brief description of the service, such as "Custom cleanup script".

After: The name of another unit that this service should start after, such as "network.target".

ConditionPathExists: The path of the file or directory that must exist for the service to start, such as "/opt/scripts/cleanup.sh".

[Service]: This section defines how the service should be started and stopped, and what commands should be executed. The administrator should specify the following options in this section:

Type: The type of the service, such as "oneshot", which means that the service will run once and then exit.

ExecStart: The command that will start the service, such as "/bin/bash /opt/scripts/cleanup.sh".

RemainAfterExit: A boolean value that indicates whether the service should remain active after the command exits, such as "yes".

[Install]: This section defines how the service should be enabled and under what circumstances it should be started. The administrator should specify the following option in this section:

WantedBy: The name of another unit that wants this service to be started, such as "multiuser. target", which means that the service will be started when the system reaches the multi-user mode.

Run the command systemctl enable cleanup. This command will enable the service and create the necessary symbolic links to start the service at boot.

Run the command systemctl is-enabled cleanup. This command will check the status of the service and confirm that it is enabled.

This process will create a custom script, cleanup.sh, to run at boot as part of the system services. This is the correct process to use to accomplish the task. The other options are incorrect because they either use the wrong directory for the unit file (/etc/default/, /etc/skel/, or /etc/sysctl.d/) or do not create a unit file at all. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15:

Managing System Services, pages 457-459.

A Linux system is failing to boot. The following error is displayed in the serial console:

[[1;33mDEPEND[Om] Dependency failed for /data.

[[1;33mDEPEND[Om] Dependency failed for Local File Systems

... Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode.

Give root password for maintenance (or type Control-D to continue}

Which of the following files will need to be modified for this server to be able to boot again?

A.
/etc/mtab
A.
/etc/mtab
Answers
B.
/dev/sda
B.
/dev/sda
Answers
C.
/etc/fstab
C.
/etc/fstab
Answers
D.
/ete/grub.conf
D.
/ete/grub.conf
Answers
Suggested answer: C

Explanation:

The file that will need to be modified for the server to be able to boot again is /etc/fstab. The /etc/fstab file is a file that contains the information about the file systems that are mounted at boot time on Linux systems. The file specifies the device name, mount point, file system type, mount options, dump frequency, and pass number for each file system. The error message indicates that the dependency failed for /data, which is a mount point for a file system. This means that the system could not mount the /data file system at boot time, which caused the system to enter the emergency mode. The emergency mode is a mode that allows the administrator to log in as the root user and perform basic tasks such as repairing the system. The administrator should modify the /etc/fstab file and check the entry for the /data file system. The administrator should look for any errors or inconsistencies in the device name, file system type, or mount options, and correct them. The administrator should also verify that the device and the file system are intact and functional by using commands such as blkid, fdisk, fsck, or mount. The administrator should then reboot the system and see if the issue is resolved. The file that will need to be modified for the server to be able to boot again is /etc/fstab. This is the correct answer to the question. The other options are incorrect because they are not related to the file systems that are mounted at boot time (/etc/mtab, /dev/sda, or /etc/grub.conf). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10:

Managing Storage, page 321.

A systems administrator frequently connects to a remote host via SSH and a non-standard port. The systems administrator would like to avoid passing the port parameter on the command line every time. Which of the following files can be used to set a different port value for that host?

A.
/etc/ssh/sshd_config
A.
/etc/ssh/sshd_config
Answers
B.
/etc/ssh/moduli
B.
/etc/ssh/moduli
Answers
C.
~/.ssh/config
C.
~/.ssh/config
Answers
D.
~/.ssh/authorized_keys
D.
~/.ssh/authorized_keys
Answers
Suggested answer: C

Explanation:

The ~/.ssh/config file can be used to set various options for SSH connections, including the port number, for specific hosts or groups of hosts. This file is located in the user's home directory and affects only the current user. The /etc/ssh/sshd_config file is used to configure the SSH server daemon, not the client. The /etc/ssh/moduli file contains parameters for Diffie-Hellman key exchange, not port settings. The ~/.ssh/authorized_keys file contains public keys for authentication, not port settings. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Secure Shell (SSH), page 414.

A Linux administrator modified the SSH configuration file. Which of the following commands should be used to apply the configuration changes?

A.
systemctl stop sshd
A.
systemctl stop sshd
Answers
B.
systemctl mask sshd
B.
systemctl mask sshd
Answers
C.
systemctl reload sshd
C.
systemctl reload sshd
Answers
D.
systemctl start sshd
D.
systemctl start sshd
Answers
Suggested answer: C

Explanation:

The systemctl reload sshd command can be used to apply the configuration changes of the SSH server daemon without restarting it. This is useful to avoid interrupting existing connections. The systemctl stop sshd command would stop the SSH server daemon, not apply the changes. The systemctl mask sshd command would prevent the SSH server daemon from being started, not apply the changes. The systemctl start sshd command would start the SSH server daemon if it is not running, but it would not apply the changes if it is already running. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Secure Shell (SSH), page 415.

A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server.

Which of the following commands can help to achieve the goal?

A.
ifconfig hw eth1
A.
ifconfig hw eth1
Answers
B.
netstat -r eth1
B.
netstat -r eth1
Answers
C.
ss -ti eth1
C.
ss -ti eth1
Answers
D.
ip link show eth1
D.
ip link show eth1
Answers
Suggested answer: D

Explanation:

The ip link show eth1 command can be used to check the link status of a network interface named eth1 in a Linux server. It will display information such as the MAC address, MTU, state, and flags of the interface. The ifconfig hw eth1 command is invalid, as hw is not a valid option for ifconfig. The netstat -r eth1 command would display the routing table for eth1, not the link status. The ss -ti eth1 command would display TCP information for sockets associated with eth1, not the link status. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Networking Fundamentals, page 436.

Total 371 questions
Go to page: of 38