CompTIA XK0-005 Exam Practice Questions (P. 2)
- Full Access (442 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 #11
A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?
- Apodman run -d -p 443:8443 httpd
- Bpodman run -d -p 8443:443 httpdMost Voted
- Cpodman run –d -e 443:8443 httpd
- Dpodman exec -p 8443:443 httpd
Correct Answer:
A
A

Correct, to map a container's internal port to a different external host port using Podman, we apply the syntax in option A: '-p 443:8443'. Here, '443' is the host machine’s port you're exposing, and '8443' is the port the httpd server inside the container is set to listen on. This command ensures that any requests sent to the host on port 443 are correctly routed to port 8443 on the container, aligning with standard Podman port mapping practices.
send
light_mode
delete
Question #12
A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?
- Adocker run -ti app /bin/sh
- Bpodman exec -ti app /bin/shMost Voted
- Cpodman run -d app /bin/bash
- Ddocker exec -d app /bin/bash
Correct Answer:
B
B

To properly access and troubleshoot a running container, using the `podman exec -ti app /bin/sh` command is the way to go. The command integrates the -ti flag to keep the session interactive and attach a terminal, which is essential for real-time debugging. This specific use of the command enables you to open a shell session inside the running container 'app', where you can then execute shell commands to explore the logs or any other issues the application might be experiencing. This effectively allows navigation and manipulation within the container as needed for thorough analysis.
send
light_mode
delete
Question #13
A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?
- Atar -cvzf /dev/sdd1 /dev/sdc1
- Brsync /dev/sdc1 /dev/sdd1
- Cdd if=/dev/sdc1 of=/dev/sdd1Most Voted
- Dscp /dev/sdc1 /dev/sdd1
Correct Answer:
C
C

The 'dd' command is ideally suited for cloning partitions due to its ability to perform low-level copying of data. Using 'dd if=/dev/sdc1 of=/dev/sdd1', 'if' stands for input file, which is the source partition, and 'of' for output file, the target partition. This direct block-level copying ensures an exact replica of the source partition, making 'dd' a potent tool in system administration for data migration or backup. Remember, its power also demands caution to avoid accidental data loss by ensuring correct command usage.
send
light_mode
delete
Question #14
When trying to log in remotely to a server, a user receives the following message:

The server administrator is investigating the issue on the server and receives the following outputs:

Which of the following is causing the issue?

The server administrator is investigating the issue on the server and receives the following outputs:

Which of the following is causing the issue?
- AThe wrong permissions are on the user’s home directory.
- BThe account was locked out due to three failed logins.
- CThe user entered the wrong password.
- DThe user has the wrong shell assigned to the account.Most Voted
Correct Answer:
D
D
send
light_mode
delete
Question #15
A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.)
- Awget
- Bssh-keygen
- Cssh-keyscan
- Dssh-copy-id
- Eftpd
- Fscp
Correct Answer:
DF
DF

Both 'ssh-copy-id' and 'scp' are indeed the right tools for transferring SSH keys to a remote server. Using 'ssh-copy-id' simplifies things by directly appending the public key to the remote server's authorized_keys file, making future logins possible without a password. On the other hand, 'scp' is super flexible and can securely transfer the key file to any specified location on the remote server. This duo covers both aspects of ease and flexibility when managing SSH keys in various scenarios. So, either to append directly or have more control over placement, these commands got you covered!
send
light_mode
delete
Question #16
A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?
- Aecho 1 > /proc/sys/net/ipv4/ipv_forward
- Bsysctl -w net.ipv4.ip_forward=1
- Cfirewall-cmd --enable ipv4_forwarding
- Dsystemctl start ipv4_forwarding
Correct Answer:
B
B

To enable IPv4 packet forwarding persistently on a Linux server, use the `sysctl -w net.ipv4.ip_forward=1` command, which modifies kernel parameters at runtime to configure the system’s behavior. This command sets the packet forwarding feature to active for IPv4, with the `-w` option ensuring this configuration is immediately applied. However, to keep this setting even after a reboot, it’s necessary to add `net.ipv4.ip_forward=1` into the `/etc/sysctl.conf` file and then run `sysctl -p` to persist the settings across boots.
send
light_mode
delete
Question #17
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
- AThe checkdiskspace.service is not running.
- BThe checkdiskspace.service needs to be enabled.
- CThe OnCalendar schedule is incorrect in the timer definition.Most Voted
- DThe system-daemon services need to be reloaded.
Correct Answer:
D
D

When setting up systemd timers, the "OnCalendar" directive is crucial for determining the execution schedule. A common mistake when configuring these timers is incorrectly setting this directive, leading to a job running at unintended intervals. In this example, since the job is running daily instead of every two hours as intended, it suggests that the OnCalendar configuration does not match the requirement "0 */2 * * *", which dictates a two-hour interval. To fix this, the administrator needs to correct the OnCalendar entry according to the desired schedule.
send
light_mode
delete
Question #18
An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?
- Asemanage port -d -t http_port_t -p tcp 6379
- Bsemanage port -a -t http_port_t -p tcp 6379Most Voted
- Csemanage port -a http_port_t -p top 6379
- Dsemanage port -l -t http_port_tcp 6379
Correct Answer:
B
B
send
light_mode
delete
Question #19
A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?
- Ahostnamectl status --no-ask-password
- Bhostnamectl set-hostname "$(perl -le "print" "A" x 86)"
- Chostnamectl set-hostname Comptia-WebNode -H [email protected]Most Voted
- Dhostnamectl set-hostname Comptia-WebNode --transient
Correct Answer:
C
C

The accurate answer lies in understanding how hostnamectl operates within Linux systems, particularly for remote actions. By using the hostnamectl set-hostname in combination with the -H option, this command facilitates setting the hostname for a remote host identified by its IP address - in this case, Comptia-WebNode at the IP address specified. This action ensures the server can be recognized and accessed via its hostname, indirectly functioning as a 'tag' for easier connectivity and identification by end users. Correct configuration of hostnames is crucial for system management and ensuring that services like web applications are consistently reachable.
send
light_mode
delete
Question #20
A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?
- Ascp -p /data remote:/backup/data
- Bssh -i /remote:/backup/ /data
- Crsync -a /data remote:/backup/Most Voted
- Dcp -r /data /remote/backup/
Correct Answer:
C
C

The correct choice here is C, using rsync with the -a option. This method ensures that not only the files and directories are copied over to the remote location, but also that their permissions, timestamps, and other important attributes are preserved throughout the transfer. This makes rsync an optimal choice for backups where maintaining the integrity and the original state of data is crucial. Moreover, rsync uses compression and delta encoding to save bandwidth, making the transfer efficient, especially for updates where changes are minor.
send
light_mode
delete
All Pages