CompTIA XK0-005 Exam Practice Questions (P. 1)
- Full Access (344 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #1
An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct version of this file?
- Arpm -qa | grep kernel; uname -a
- Byum -y update; shutdown -r now
- Ccat /etc/centos-release; rpm -Uvh --nodeps
- Dtelinit 1; restorecon -Rv /boot
Correct Answer:
A
A

It's vital to first list the installed kernel versions and then check what kernel version is currently active when dealing with the accidental deletion of /boot/vmlinuz. Using 'rpm -qa | grep kernel' identifies all kernel packages installed on the system, and 'uname -a' confirms the active kernel version. By correlating this information, you can ensure the correct version of the vmlinuz file is restored, preventing potential system boot issues.
send
light_mode
delete
Question #2
A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?
- A/etc/host.conf
- B/etc/hostname
- C/etc/services
- D/etc/ssh/sshd_config
Correct Answer:
D
D

Absolutely! D. /etc/ssh/sshd_config is the correct choice. To update the SSH port, modify "/etc/ssh/sshd_config" by altering the 'Port' line from 22 to 49000. This file configures the SSH daemon settings, including the port used for connections. Changes require a restart of the SSH service to be applied. This is crucial for both security and ensuring the SSH daemon listens on the new specified port.
send
light_mode
delete
Question #3
A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?
- Agit reflog
- Bgit pull
- Cgit status
- Dgit push
Correct Answer:
B
B

The "git pull" command is ideal for synchronizing a local repository with updates from a main repository. It efficiently combines two primary actions: fetching updates from the remote repository and merging them into the local branch. This ensures the local copy reflects the most recent changes, including new files added remotely. Always ensure that the local environment is prepared for a merge by being on the correct branch and having a clean working state.
send
light_mode
delete
Question #4
A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?
- Aiptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128
- Biptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192.0.2.25:3129
- Ciptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192.0.2.25:3129
- Diptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128Most Voted
Correct Answer:
D
D

The iptables command "iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.0.2.25:3128" is indeed the correct method for redirecting all HTTP traffic intended for port 80 to a new proxy server address and port. This command effectively manipulates packets as soon as they arrive by appending a rule (-A) to the PREROUTING chain of the NAT table. It specifically targets TCP packets and changes the destination address and port to those of the new proxy, ensuring that any incoming HTTP requests are intercepted and redirected appropriately.
send
light_mode
delete
Question #5
Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?
- Aroute -i etho -p add 10.0.213.5 10.0.5.1
- Broute modify eth0 +ipv4.routes "10.0.213.5/32 10.0.5.1"
- Cecho "10.0.213.5 10.0.5.1 eth0" > /proc/net/route
- Dip route add 10.0.213.5/32 via 10.0.5.1 dev eth0Most Voted
Correct Answer:
D
D

To establish a persistent, static route on a server using the eth0 interface, the command 'ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0' is the correct choice. This command directs packets destined for 10.0.213.5/32 to be routed via the gateway 10.0.5.1 specifically over the eth0 interface. For persistence, this command should be added to a startup script like /etc/rc.local or a similar configuration file based on the Linux distribution. This ensures the route remains active even after the system reboots.
send
light_mode
delete
Question #6
A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given the following:

Which of the following commands should replace the <CONDITIONAL> string?

Which of the following commands should replace the <CONDITIONAL> string?
- Aif [ -f "$filename" ]; then
- Bif [ -d "$filename" ]; then
- Cif [ -f "$filename" ] then
- Dif [ -f "$filename" ]; while
Correct Answer:
A
A
send
light_mode
delete
Question #7
DRAG DROP -
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses related files in /var/log without recursion.
INSTRUCTIONS:
Drag and drop snippets to fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses related files in /var/log without recursion.
INSTRUCTIONS:
Drag and drop snippets to fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.

send
light_mode
delete
Question #8
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:

Which of the following technologies is the administrator using?

Which of the following technologies is the administrator using?
send
light_mode
delete
Question #9
Which of the following technologies can be used as a central repository of Linux users and groups?
- ALDAPMost Voted
- BMFA
- CSSO
- DPAM
Correct Answer:
A
A

LDAP, short for Lightweight Directory Access Protocol, operates as a centralized database for storing and managing user and group information across multiple systems within an organization. Its ability to maintain and distribute accurate directory information, like user credentials and permissions, makes it distinctively suitable as a central repository in contrast to other options like MFA, SSO, or PAM, which handle different aspects of authentication and do not store such data. This makes LDAP an effective and efficient solution for centralized user and group management in Linux environments.
send
light_mode
delete
Question #10
A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:

Based on the output above, which of following is the MOST probable cause of the issue?

Based on the output above, which of following is the MOST probable cause of the issue?
- AThe address ac:00:11:22:33:cd is not a valid Ethernet address.
- BThe Ethernet broadcast address should be ac:00:11:22:33:ff instead.
- CThe network interface eth0 is using an old kernel module.
- DThe network interface cable is not connected to a switch.
Correct Answer:
D
D
send
light_mode
delete
All Pages