ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











Which of the following can be used as a secure way to access a remote terminal?

A.
TFTP
A.
TFTP
Answers
B.
SSH
B.
SSH
Answers
C.
SCP
C.
SCP
Answers
D.
SFTP
D.
SFTP
Answers
Suggested answer: B

Explanation:

SSH, or Secure Shell, is a protocol that allows you to access a remote terminal or virtual machine securely over an encrypted connection. You can use SSH to run commands, transfer files, or tunnel network traffic on a remote system. To use SSH, you need an SSH client program on your local system and an SSH server program on the remote system. You also need to authenticate yourself using a username and password or a public/private key pair. SSH is widely used by system administrators, developers, and engineers to remotely manage Linux servers and other devices.

The other options are not correct answers. TFTP, or Trivial File Transfer Protocol, is a simple protocol that allows you to transfer files between systems, but it does not provide any security or encryption features. SCP, or Secure Copy Protocol, is a protocol that uses SSH to securely copy files between systems, but it does not provide a remote terminal access. FTP, or File Transfer Protocol, is another protocol that allows you to transfer files between systems, but it also does not provide any security or encryption features.

A user reported issues when trying to log in to a Linux server. The following outputs were received:

Given the outputs above. which of the following is the reason the user is unable to log in to the server?

A.
User1 needs to set a long password.
A.
User1 needs to set a long password.
Answers
B.
User1 is in the incorrect group.
B.
User1 is in the incorrect group.
Answers
C.
The user1 shell assignment incorrect.
C.
The user1 shell assignment incorrect.
Answers
D.
The user1 password is expired.
D.
The user1 password is expired.
Answers
Suggested answer: D

Explanation:

The user1 password is expired. This can be inferred from the output of the chage -l user1 command, which shows the password expiration information for user1. The output shows that the password expired on 2020-10-01, and the account expired on 2020-10-08. This means that user1 cannot log in to the server unless the password and account are reactivated by the system administrator.

The other options are not correct based on the outputs above. User1 does not need to set a long password, because the output of the passwd -S user1 command shows that the password has a minimum length of 5 characters, which is met by user1's password. User1 is not in the incorrect group, because the output of the groups user1 command shows that user1 belongs to the app group, which is presumably the correct group for accessing the server. The user1 shell assignment is not incorrect, because the output of the grep user1 /etc/passwd command shows that user1 has /bin/bash as the default shell, which is a valid and common shell for Linux users.

A systems administrator wants to list all local accounts in which the UID is greater than 500. Which of the following commands will give the correct output?

A.
find /etc/passwd -size +500
A.
find /etc/passwd -size +500
Answers
B.
cut -d: fl / etc/ passwd > 500
B.
cut -d: fl / etc/ passwd > 500
Answers
C.
awk -F: ‘$3 > 500 {print $1}' /etc/passwd
C.
awk -F: ‘$3 > 500 {print $1}' /etc/passwd
Answers
D.
sed '/UID/' /etc/passwd < 500
D.
sed '/UID/' /etc/passwd < 500
Answers
Suggested answer: C

Explanation:

The correct command to list all local accounts in which the UID is greater than 500 is:

awk -F: '$3 > 500 {print $1}' /etc/passwd

This command uses awk to process the /etc/passwd file, which contains information about the local users on the system. The -F: option specifies that the fields are separated by colons. The $3 refers to the third field, which is the UID. The condition $3 > 500 filters out the users whose UID is greater than 500. The action {print $1} prints the first field, which is the username.

The other commands are incorrect because:

find /etc/passwd -size +500 will search for files that are larger than 500 blocks in size, not users with UID greater than 500.

cut -d: fl / etc/ passwd > 500 will cut the first field of the /etc/passwd file using colon as the delimiter, but it will not filter by UID or print only the usernames. The > 500 part will redirect the output to a file named 500, not compare with the UID.

sed '/UID/' /etc/passwd < 500 will use sed to edit the /etc/passwd file and replace any line that contains UID with 500, not list the users with UID greater than 500. The < 500 part will redirect the input from a file named 500, not compare with the UID.

Reference:

Linux List All Users In The System Command - nixCraft, section "List all users in Linux using /etc/passwd file".

Unix script getting users with UID bigger than 500 - Stack Overflow, section "Using awk".

A Linux administrator has physically added a new RAID adapter to a system. Which of the following commands should the Linux administrator run to confirm that the device has been recognized?

(Select TWO).

A.
rmmod
A.
rmmod
Answers
B.
Is -11 /etc
B.
Is -11 /etc
Answers
C.
Ishw -class disk
C.
Ishw -class disk
Answers
D.
pvdisplay
D.
pvdisplay
Answers
E.
rmdir /dev
E.
rmdir /dev
Answers
F.
dmesg
F.
dmesg
Answers
Suggested answer: C, F

Explanation:

The following commands can help you confirm that the new RAID adapter has been recognized by the Linux system:

dmesg: This command displays the kernel messages, which can show the information about the newly detected hardware device. You can use dmesg | grep -i raid to filter the output for RAIDrelated messages.

lshw -class disk: This command lists the disk devices on the system, including the RAID controller and its model name. You can use lshw -class disk | grep -i raid to filter the output for RAID-related information1.

The other commands are not relevant for this purpose. For example:

rmmod: This command removes a module from the Linux kernel, which is not useful for detecting a new device.

ls -l /etc: This command lists the files and directories in the /etc directory, which is not related to hardware devices.

pvdisplay: This command displays the attributes of physical volumes, which are part of the logical volume management (LVM) system, not the RAID system.

rmdir /dev: This command removes an empty directory, which is not helpful for detecting a new device. Moreover, /dev is a special directory that contains device files, and should not be removed.

A user is attempting to log in to a Linux server that has Kerberos SSO enabled. Which of the following commands should the user run to authenticate and then show the ticket grants? (Select TWO).

A.
kinit
A.
kinit
Answers
B.
klist
B.
klist
Answers
C.
kexec
C.
kexec
Answers
D.
kioad
D.
kioad
Answers
E.
pkexec
E.
pkexec
Answers
F.
realm
F.
realm
Answers
Suggested answer: A, B

Explanation:

The following commands can help the user to authenticate and show the ticket grants using Kerberos SSO on a Linux server:

kinit: This command obtains and caches an initial ticket-granting ticket (TGT) for the user from the

Kerberos key distribution center (KDC). The user needs to enter their password or use a keytab file to authenticate1.

klist: This command lists the cached tickets, including the TGT and any service tickets, for the user. It also shows the expiration time and flags for each ticket2.

For example, the user can run the following commands to log in and view their tickets:

$ kinit username@REALM Password for username@REALM:

$ klist

Ticket cache: FILE:/tmp/krb5cc_1000

Default principal: username@REALM

Valid starting Expires Service principal

04/06/2023 16:06:59 04/07/2023 02:06:59 krbtgt/REALM@REALM

renew until 04/13/2023 16:06:59

Reference:

kinit(1) - Linux man page, section "Description".


A Linux administrator is reviewing changes to a configuration file that includes the following section:

The Linux administrator is trying to select the appropriate syntax formatter to correct any issues with the configuration file. Which of the following should the syntax formatter support to meet this goal?

A.
Markdown
A.
Markdown
Answers
B.
XML
B.
XML
Answers
C.
YAML
C.
YAML
Answers
D.
JSON
D.
JSON
Answers
Suggested answer: C

Explanation:

The configuration file shown in the image is written in YAML format, so the syntax formatter should support YAML to correct any issues with the file. YAML stands for YAML Ain't Markup Language, and it is a human-readable data serialization language that uses indentation and colons to define keyvalue pairs. YAML supports various data types, such as scalars, sequences, mappings, anchors, aliases, and tags. The configuration file follows the rules and syntax of YAML, while the other options do not. Markdown is a lightweight markup language that uses plain text formatting to create rich text documents. XML is a markup language that uses tags to enclose elements and attributes. JSON is a data interchange format that uses curly braces to enclose objects and square brackets to enclose arrays. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 21: Automating Tasks with Ansible, page 591.

A systems administrator is investigating an issue in which one of the servers is not booting up properly. The journalctl entries show the following:

Which of the following will allow the administrator to boot the Linux system to normal mode quickly?

A.
Comment out the /opt/app filesystem in /etc/fstab and reboot.
A.
Comment out the /opt/app filesystem in /etc/fstab and reboot.
Answers
B.
Reformat the /opt/app filesystem and reboot.
B.
Reformat the /opt/app filesystem and reboot.
Answers
C.
Perform filesystem checks on local filesystems and reboot.
C.
Perform filesystem checks on local filesystems and reboot.
Answers
D.
Trigger a filesystem relabel and reboot.
D.
Trigger a filesystem relabel and reboot.
Answers
Suggested answer: A

Explanation:

The fastest way to boot the Linux system to normal mode is to comment out the /opt/app filesystem in /etc/fstab and reboot. This will prevent the system from trying to mount the /opt/app filesystem at boot time, which causes an error because the filesystem does not exist or is corrupted. Commenting out a line in /etc/fstab can be done by adding a # symbol at the beginning of the line. Rebooting the system will apply the changes and allow the system to boot normally. Reformatting the /opt/app filesystem will not help to boot the system, as it will erase any data on the filesystem and require manual intervention to create a new filesystem. Performing filesystem checks on local filesystems will not help to boot the system, as it will not fix the missing or corrupted /opt/app filesystem.

Triggering a filesystem relabel will not help to boot the system, as it will only change the security context of files and directories according to SELinux policy. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Disk Storage, page 456.

A Linux systems administrator receives reports from various users that an application hosted on a server has stopped responding at similar times for several days in a row. The administrator logs in to the system and obtains the following output:

Output 1:

Output 2:

Output 3:

Which of the following should the administrator do to provide the BEST solution for the reported issue?

A.
Configure memory allocation policies during business hours and prevent the Java process from going into a zombie state while the server is idle.
A.
Configure memory allocation policies during business hours and prevent the Java process from going into a zombie state while the server is idle.
Answers
B.
Configure a different nice value for the Java process to allow for more users and prevent the Java process from restarting during business hours.
B.
Configure a different nice value for the Java process to allow for more users and prevent the Java process from restarting during business hours.
Answers
C.
Configure more CPU cores to allow for the server to allocate more processing and prevent the Java process from consuming all of the available resources.
C.
Configure more CPU cores to allow for the server to allocate more processing and prevent the Java process from consuming all of the available resources.
Answers
D.
Configure the swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory.
D.
Configure the swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory.
Answers
Suggested answer: D

Explanation:

Based on the output of the image sent by the user, the system requires more swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory. The output shows that there is only 0 MB of swap space available on the system, which means that there is no room for swapping out memory pages when physical memory is full or low.

The output also shows that there is only 793 MB of available memory on the system, which may not be enough to handle high-demand applications such as Java. This may cause Java to stop working due to insufficient memory or trigger an OutOfMemoryError exception. Configuring more swap space on the system would help to alleviate this issue by providing more virtual memory for applications and improving performance. Configuring memory allocation policies during business hours will not help to solve this issue, as it will not increase the amount of available memory or swap space on the system. Configuring a different nice value for Java process will not help to solve this issue, as it will only affect its scheduling priority, not its memory consumption or allocation.

Configuring more CPU cores will not help to solve this issue, as it will only increase processing power, not memory capacity or availability. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Memory and Process Execution, page 468.

A Linux administrator found many containers in an exited state. Which of the following commands will allow the administrator to clean up the containers in an exited state?

A.
docker rm --all
A.
docker rm --all
Answers
B.
docker rm $(docker ps -aq)
B.
docker rm $(docker ps -aq)
Answers
C.
docker images prune *
C.
docker images prune *
Answers
D.
docker rm --state exited
D.
docker rm --state exited
Answers
Suggested answer: B

Explanation:

The command docker rm $(docker ps -aq) will allow the administrator to clean up the containers in an exited state. The docker command is a tool for managing Docker containers on Linux systems.

Docker containers are isolated and lightweight environments that can run applications and services without affecting the host system. Docker uses images to create containers, which are files that contain the code, libraries, dependencies, and configuration of the applications and services.

The rm option removes one or more containers. The $(docker ps -aq) is a command substitution that executes the command inside the parentheses and replaces it with the output. The docker ps -aq command lists all the containers, including the ones in an exited state, and shows only their IDs.

The docker rm $(docker ps -aq) command will remove all the containers, including the ones in an exited state, by passing their IDs to the rm option. This will allow the administrator to clean up the containers in an exited state. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not exist (docker rm --all or docker rm --state exited) or do not remove the containers (docker images prune *). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 571.

A Linux administrator has set up a new DNS forwarder and is configuring all internal servers to use the new forwarder to look up external DNS requests. The administrator needs to modify the firewall on the server for the DNS forwarder to allow the internal servers to communicate to it and make the changes persistent between server reboots. Which of the following commands should be run on the DNS forwarder server to accomplish this task?

A.
ufw allow out dns
A.
ufw allow out dns
Answers
B.
systemctl reload firewalld
B.
systemctl reload firewalld
Answers
C.
iptables -A OUTPUT -p udp -ra udp -dport 53 -j ACCEPT
C.
iptables -A OUTPUT -p udp -ra udp -dport 53 -j ACCEPT
Answers
D.
flrewall-cmd --zone-public --add-port-53/udp --permanent
D.
flrewall-cmd --zone-public --add-port-53/udp --permanent
Answers
Suggested answer: D

Explanation:

The command that should be run on the DNS forwarder server to accomplish the task is firewall-cmd

--zone=public --add-port=53/udp --permanent. The firewall-cmd command is a tool for managing firewalld, which is a firewall service that provides dynamic and persistent network security on Linux systems. The firewalld uses zones and services to define the rules and policies for the network traffic.

The zones are logical groups of network interfaces and sources that have the same level of trust and security. The services are predefined sets of ports and protocols that are associated with certain applications or functions. The --zone=public option specifies the zone name that the rule applies to.

The public zone is the default zone that represents the untrusted network, such as the internet. The --add-port=53/udp option adds a port and protocol to the zone. The 53 is the port number that is used by the DNS service. The udp is the protocol that is used by the DNS service. The --permanent option makes the change persistent across reboots. The command firewall-cmd --zone=public --add-port=53/udp --permanent will modify the firewall on the server for the DNS forwarder to allow the internal servers to communicate to it and make the changes persistent between server reboots. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not modify the firewall on the server for the DNS forwarder (ufw allow out dns or systemctl reload firewalld) or do not use the correct syntax for the command (iptables -A OUTPUT -p udp -ra udp -dport 53 -j ACCEPT instead of iptables -A OUTPUT -p udp -ra udp --dport 53 -j ACCEPT). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 392.

Total 371 questions
Go to page: of 38