ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











An administrator would like to mirror the website files on the primary web server, www1, to the backup web server, www2. Which of the following commands should the administrator use to most efficiently accomplish this task?

A.
[wwwl ] rsync ---a ---e ssh /var/www/html/ user1@www2 : /var/www/html
A.
[wwwl ] rsync ---a ---e ssh /var/www/html/ user1@www2 : /var/www/html
Answers
B.
[ wwwl ] scp ---r /var/www/html user1@www2 : / var/www/html
B.
[ wwwl ] scp ---r /var/www/html user1@www2 : / var/www/html
Answers
C.
[www2 ] cd /var/www/html; wget ---m http: //wwwl/
C.
[www2 ] cd /var/www/html; wget ---m http: //wwwl/
Answers
D.
[wwwl ] cd /var/www/html && tar cvf ---
D.
[wwwl ] cd /var/www/html && tar cvf ---
Answers
Suggested answer: A

Explanation:

To mirror the website files on the primary web server, www1, to the backup web server, www2, the administrator can use the commandrsync -a -e ssh /var/www/html/ user1@www2:/var/www/html(A). This will synchronize all files and directories under/var/www/html/on www1 to/var/www/htmlon www2 using ssh as the remote shell. The-aoption will preserve all attributes and permissions of the files. The other commands will not mirror the website files, but either copy them once, download them from a web server, or archive them.Reference:

[CompTIA Linux+ Study Guide], Chapter 12: Troubleshooting Linux Systems, Section: Synchronizing Files with rsync

[How to Use rsync Command in Linux]

An administrator needs to get network information from a group of statically assigned workstations before they are reconnected to the network. Which of the following should the administrator use to obtain this information?

A.
ip show
A.
ip show
Answers
B.
ifcfg ---a
B.
ifcfg ---a
Answers
C.
ifcfg ---s
C.
ifcfg ---s
Answers
D.
i fname ---s
D.
i fname ---s
Answers
Suggested answer: B

Explanation:

Theifcfgcommand is used to configure network interfaces on Linux systems. The-aoption displays information about all network interfaces, including their IP addresses, netmasks, gateways, and other parameters. This command can help the administrator obtain the network information from the statically assigned workstations before they are reconnected to the network.Reference: [Linux Networking: ifcfg Command With Examples]

A developer wants to ensure that all files and folders created inside a shared folder named /GroupOODEV inherit the group name of the parent folder. Which of the following commands will help achieve this goal?

A.
chmod g+X / GroupOODEV/
A.
chmod g+X / GroupOODEV/
Answers
B.
chmod g+W / GroupOODEV/
B.
chmod g+W / GroupOODEV/
Answers
C.
chmod g+r / GroupOODEV/
C.
chmod g+r / GroupOODEV/
Answers
D.
chmod g+s / GroupOODEV/
D.
chmod g+s / GroupOODEV/
Answers
Suggested answer: D

Explanation:

Thechmodcommand is used to change the permissions of files and directories on Linux systems. Theg+soption sets the setgid bit on a directory, which means that all files and folders created inside that directory will inherit the group name of the parent directory. This command can help the developer ensure that all files and folders created inside the /GroupOODEV directory have the same group name as /GroupOODEV.Reference: [How to Use chmod Command in Linux with Examples]

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the Is command. The output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

A.
su - Joe
A.
su - Joe
Answers
B.
sudo Joe
B.
sudo Joe
Answers
C.
visudo Joe
C.
visudo Joe
Answers
D.
pkexec joe
D.
pkexec joe
Answers
Suggested answer: A

Explanation:

Thesucommand is used to switch to another user account on Linux systems. The-option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of the original user. This can cause confusion when issuing commands that depend on these variables, such asls, which uses the$HOMEvariable to determine the home directory. Therefore, Ann should have issuedsu - Joeto list Joe's files instead of her own.Reference: [How to Use su Command in Linux with Examples]

The applications team is reporting issues when trying to access the web service hosted in a Linux system. The Linux systems administrator is reviewing the following outputs:

Output 1:

* httpd.service = The Apache HTTPD Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

Active: inactive (dead)

Docs: man:httpd(8) man:apachectl(8)

Output 2:

16:51:16 up 28 min, 1 user, load average: 0.00, 0.00, 0.07

Which of the following statements best describe the root cause? (Select two).

A.
The httpd service is currently started.
A.
The httpd service is currently started.
Answers
B.
The httpd service is enabled to auto start at boot time, but it failed to start.
B.
The httpd service is enabled to auto start at boot time, but it failed to start.
Answers
C.
The httpd service was manually stopped.
C.
The httpd service was manually stopped.
Answers
D.
The httpd service is not enabled to auto start at boot time.
D.
The httpd service is not enabled to auto start at boot time.
Answers
E.
The httpd service runs without problems.
E.
The httpd service runs without problems.
Answers
F.
The httpd service did not start during the last server reboot.
F.
The httpd service did not start during the last server reboot.
Answers
Suggested answer: C, D

Explanation:

Thehttpd.serviceis the Apache HTTPD Server, which is a web service that runs on Linux systems. The output 1 shows that thehttpd.serviceisinactive (dead), which means that it is not running. The output 1 also shows that thehttpd.serviceisdisabled, which means that it is not enabled to auto start at boot time. Therefore, the statements C and D best describe the root cause of the issue. The statements A, B, E, and F are incorrect because they do not match the output 1.Reference: [How to Manage Systemd Services on a Linux System]

A user is unable to remotely log on to a server using the server name server1 and port 22. The Linux engineer troubleshoots the issue and gathers the following information:

Which of the following is most likely causing the issue?

A.
server 1 is not in the DNS.
A.
server 1 is not in the DNS.
Answers
B.
sshd is running on a non-standard port.
B.
sshd is running on a non-standard port.
Answers
C.
sshd is not an active service.
C.
sshd is not an active service.
Answers
D.
serverl is using an incorrect IP address.
D.
serverl is using an incorrect IP address.
Answers
Suggested answer: B

Explanation:

Thesshdis the Secure Shell Daemon, which is a service that allows remote login to a Linux system using the SSH protocol. The output shows that thesshdis running on port2222, which is a non-standard port for SSH. The default port for SSH is22, which is what the user is trying to use. Therefore, the statement B is most likely causing the issue. The statements A, C, and D are incorrect because they do not explain why the user cannot log on using port 22.Reference: [How to Change SSH Port in Linux]

A systems administrator wants to upgrade /bin/ someapp to a new version, but the administrator does not know the package name. Which of the following will show the RPM package name that provides that binary file?

A.
rpm ---qf /bin/ someapp
A.
rpm ---qf /bin/ someapp
Answers
B.
rpm ---Vv / bin/ someapp
B.
rpm ---Vv / bin/ someapp
Answers
C.
rpm - P / bin/ some app
C.
rpm - P / bin/ some app
Answers
D.
rpm ---i / bin/ someapp
D.
rpm ---i / bin/ someapp
Answers
Suggested answer: A

Explanation:

Therpmcommand is used to manage RPM packages on Linux systems. The-qfoption queries the package name that provides a given file. Therefore, the commandrpm -qf /bin/someappwill show the RPM package name that provides the binary file/bin/someapp. The statements B, C, and D are incorrect because they do not query the package name, but rather verify, remove, or install a package.Reference: [How to Use RPM Command in Linux with Examples]

A Linux administrator is trying to start the database service on a Linux server but is not able to run it. The administrator executes a few commands and receives the following output:

Which of the following should the administrator run to resolve this issue? (Select two).

A.
systemctl unmask mariadb
A.
systemctl unmask mariadb
Answers
B.
journalctl ---g mariadb
B.
journalctl ---g mariadb
Answers
C.
dnf reinstall mariadb
C.
dnf reinstall mariadb
Answers
D.
systemctl start mariadb
D.
systemctl start mariadb
Answers
E.
chkconfig mariadb on
E.
chkconfig mariadb on
Answers
F.
service mariadb reload
F.
service mariadb reload
Answers
Suggested answer: A, D

Explanation:

These commands will unmask the mariadb service, which is currently prevented from starting, and then start it normally. The other commands are either not relevant, not valid, or not sufficient for this task. For more information on how to manage masked services with systemctl, you can refer to the web search result1.

A Linux administrator is troubleshooting an issue in which users are not able to access https://portal.comptia.org from a specific workstation. The administrator runs a few commands and receives the following output:

Which of the following tasks should the administrator perform to resolve this issue?

A.
Update the name server in resolv. conf to use an external DNS server.
A.
Update the name server in resolv. conf to use an external DNS server.
Answers
B.
Remove the entry for portal . comptia.org from the local hosts file.
B.
Remove the entry for portal . comptia.org from the local hosts file.
Answers
C.
Add a network route from the 10.10.10.0/24 to the 192.168.0.0/16.
C.
Add a network route from the 10.10.10.0/24 to the 192.168.0.0/16.
Answers
D.
Clear the local DNS cache on the workstation and rerun the host command.
D.
Clear the local DNS cache on the workstation and rerun the host command.
Answers
Suggested answer: B

Explanation:

The best task to perform to resolve this issue is B. Remove the entry for portal.comptia.org from the local hosts file. This is because the local hosts file has a wrong entry that maps portal.comptia.org to 10.10.10.55, which is different from the actual IP address of 192.168.1.55 that is returned by the DNS server. This causes a mismatch and prevents the workstation from accessing the website. By removing or correcting the entry in the hosts file, the workstation will use the DNS server to resolve the domain name and access the website successfully.

To remove or edit the entry in the hosts file, you need to have root privileges and use a text editor such as vi or nano. For example, you can run the command:

sudo vi /etc/hosts

and delete or modify the line that says:

10.10.10.55 portal.comptia.org

Then save and exit the file.

A Linux administrator needs to transfer a local file named accounts . pdf to a remote / tmp directory of a server with the IP address 10.10.10.80. Which of the following commands needs to be executed to transfer this file?

A.
rsync [email protected]: /tmp accounts.pdf
A.
rsync [email protected]: /tmp accounts.pdf
Answers
B.
scp accounts.pdf [email protected]:/tmp
B.
scp accounts.pdf [email protected]:/tmp
Answers
C.
cp [email protected]. 80: /tmp accounts.pdf
C.
cp [email protected]. 80: /tmp accounts.pdf
Answers
D.
ssh accounts.pdf [email protected]: /tmp
D.
ssh accounts.pdf [email protected]: /tmp
Answers
Suggested answer: B

Explanation:

The best command to use to transfer the local file accounts.pdf to the remote /tmp directory of the server with the IP address 10.10.10.80 is B. scp accounts.pdf [email protected]:/tmp. This command will use the secure copy protocol (scp) to copy the file from the local machine to the remote server over SSH. The command requires the username and password of the user on the remote server, as well as the full path of the destination directory.

The other commands are either incorrect or not suitable for this task. For example:

A) rsync [email protected]:/tmp accounts.pdf will try to use the rsync command to synchronize files between the local and remote machines, but it has the wrong syntax and order of arguments. The source should come before the destination, and a colon (:) should separate the remote host and path.

C) cp [email protected]:/tmp accounts.pdf will try to use the cp command to copy files, but it does not work over SSH and it has the wrong syntax and order of arguments. The source should come before the destination, and a colon (:) should separate the remote host and path.

D) ssh accounts.pdf [email protected]:/tmp will try to use the ssh command to log into the remote server, but it has the wrong syntax and arguments. The username should come before the remote host, and a file name is not a valid argument for ssh.

Total 371 questions
Go to page: of 38