ExamGecko
Home / CompTIA / XK0-005 / List of questions
Ask Question

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

List of questions

Question 31

Report
Export
Collapse

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?

hostnamectl status --no-ask-password
hostnamectl status --no-ask-password
hostnamectl set-hostname "$(perl -le "print" "A" x 86)"
hostnamectl set-hostname "$(perl -le "print" "A" x 86)"
hostnamectl set-hostname Comptia-WebNode -H [email protected]
hostnamectl set-hostname Comptia-WebNode -H [email protected]
hostnamectl set-hostname Comptia-WebNode --transient
hostnamectl set-hostname Comptia-WebNode --transient
Suggested answer: C

Explanation:

The command hostnamectl set-hostname Comptia-WebNode -H [email protected] sets the hostname of the web server to Comptia-WebNode and connects to the server using the SSH protocol and the root user. This is the correct way to complete the requirement. The other options are incorrect because they either display the current hostname status (hostnamectl status), set an invalid hostname (hostnamectl set-hostname "$(perl -le "print" "A" x 86)"), or set a transient hostname that is not persistent (hostnamectl set-hostname Comptia-WebNode --transient). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 9: Managing System Components, page 291.

asked 02/10/2024
Sergio Zozulenko
40 questions

Question 32

Report
Export
Collapse

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?

scp -p /data remote:/backup/data
scp -p /data remote:/backup/data
ssh -i /remote:/backup/ /data
ssh -i /remote:/backup/ /data
rsync -a /data remote:/backup/
rsync -a /data remote:/backup/
cp -r /data /remote/backup/
cp -r /data /remote/backup/
Suggested answer: C

Explanation:

The command that will back up the directory /data and all its contents to /backup/data on a remote server named remote is rsync -a /data remote:/backup/. This command uses the rsync tool, which is a remote and local file synchronization tool. It uses an algorithm to minimize the amount of data copied by only moving the portions of files that have changed. The -a option stands for archive mode, which preserves the permissions, ownership, timestamps, and symbolic links of the files. The /data argument specifies the source directory to be backed up, and the remote:/backup/ argument specifies the destination directory on the remote server. The rsync tool will create a subdirectory named data under /backup/ on the remote server, and copy all the files and subdirectories from /data on the local server.

The other options are not correct commands for backing up a directory to a remote server. The scp -p /data remote:/backup/data command will copy the /data directory as a file named data under /backup/ on the remote server, not as a subdirectory with its contents. The -p option preserves the permissions and timestamps of the file, but not the ownership or symbolic links. The ssh -i /remote:/backup/ /data command will try to use /remote:/backup/ as an identity file for SSH authentication, which is not valid. The cp -r /data /remote/backup/ command will try to copy the /data directory to a local directory named /remote/backup/, not to a remote server. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; rsync(1) - Linux manual page

asked 02/10/2024
Donald Wu
32 questions

Question 33

Report
Export
Collapse

An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?

git clone https://github.com/comptia/linux+-.gitgit push origin
git clone https://github.com/comptia/linux+-.gitgit push origin
git clone https://qithub.com/comptia/linux+-.gitgit fetch New-Branch
git clone https://qithub.com/comptia/linux+-.gitgit fetch New-Branch
git clone https://github.com/comptia/linux+-.gitgit status
git clone https://github.com/comptia/linux+-.gitgit status
git clone https://github.com/comptia/linuxt+-.gitgit checkout -b <new-branch>
git clone https://github.com/comptia/linuxt+-.gitgit checkout -b <new-branch>
Suggested answer: D

Explanation:

The command that will maintain version control while making some changes in the IaC declaration templates is git checkout -b <new-branch>. This command uses the git tool, which is a distributed version control system that tracks changes in source code and enables collaboration among developers. The checkout option switches to a different branch in the git repository, where a branch is a pointer to a specific commit in the history. The -b option creates a new branch with the given name, and switches to it. This way, the administrator can make changes in the new branch without affecting the main branch, and later merge them if needed.

The other options are not correct commands for maintaining version control while making some changes in the IaC declaration templates. The git clone https://github.com/comptia/linux±.git command will clone an existing repository from a remote URL to a local directory, but it will not create a new branch for making changes. The git push origin command will push the local changes to a remote repository named origin, but it will not create a new branch for making changes. The git fetch New-Branch command will fetch updates from a remote branch named New-Branch, but it will not create a new branch for making changes. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Source Code; Git - Basic Branching and Merging

asked 02/10/2024
Wissam Aoun
38 questions

Question 34

Report
Export
Collapse

An administrator attempts to rename a file on a server but receives the following error.

CompTIA XK0-005 image Question 34 99675 10022024175436000000

The administrator then runs a few commands and obtains the following output:

CompTIA XK0-005 image Question 34 99675 10022024175436000000

Which of the following commands should the administrator run NEXT to allow the file to be renamed by any user?

chgrp reet files
chgrp reet files
chacl -R 644 files
chacl -R 644 files
chown users files
chown users files
chmod -t files
chmod -t files
Suggested answer: D

Explanation:

The command that the administrator should run NEXT to allow the file to be renamed by any user is chmod -t files. This command uses the chmod tool, which is used to change file permissions and access modes. The -t option removes (or sets) the sticky bit on a directory, which restricts deletion or renaming of files within that directory to only their owners or root. In this case, since files is a directory with sticky bit set (indicated by t in drwxrwxrwt), removing it will allow any user to rename or delete files within that directory.

The other options are not correct commands for allowing any user to rename files within files directory. The chgrp reet files command will change the group ownership of files directory to reet, but it will not affect its permissions or access modes. The chacl -R 644 files command is invalid, as chacl is used to change file access control lists (ACLs), not permissions or access modes. The chown users files command will change the user ownership of files directory to users, but it will not affect its permissions or access modes. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; chmod(1) - Linux manual page

asked 02/10/2024
matteo vadagnini
46 questions

Question 35

Report
Export
Collapse

Which of the following commands will display the operating system?

uname -n
uname -n
uname -s
uname -s
uname -o
uname -o
uname -m
uname -m
Suggested answer: C

Explanation:

The command that will display the operating system is uname -o. This command uses the uname tool, which is used to print system information such as the kernel name, version, release, machine, and processor. The -o option stands for operating system, and prints the name of the operating system implementation (usually GNU/Linux).

The other options are not correct commands for displaying the operating system. The uname -n command will display the network node hostname of the system. The uname -s command will display the kernel name of the system. The uname -m command will display the machine hardware name of the system. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 1:

Exploring Linux Command-Line Tools; uname(1) - Linux manual page

asked 02/10/2024
Natalia Novikova
40 questions

Question 36

Report
Export
Collapse

A systems engineer is adding a new 1GB XFS filesystem that should be temporarily mounted under /ops/app. Which of the following is the correct list of commands to achieve this goal?

Suggested answer: D

Explanation:

The list of commands in option D is the correct way to achieve the goal. The commands are as follows:

fallocate -l 1G /ops/app.img creates a 1GB file named app.img under the /ops directory.

mkfs.xfs /ops/app.img formats the file as an XFS filesystem.

mount -o loop /ops/app.img /ops/app mounts the file as a loop device under the /ops/app directory.

The other options are incorrect because they either use the wrong commands (dd or truncate instead of fallocate), the wrong options (-t or -f instead of -o), or the wrong order of arguments (/ops/app.img /ops/app instead of /ops/app /ops/app.img). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 323-324.

asked 02/10/2024
Mark Baker
40 questions

Question 37

Report
Export
Collapse

A Linux administrator recently downloaded a software package that is currently in a compressed file.

Which of the following commands will extract the files?

unzip -v
unzip -v
bzip2 -z
bzip2 -z
gzip
gzip
funzip
funzip
Suggested answer: C

Explanation:

The command gzip can extract files that are compressed with the gzip format, which has the extension .gz. This is the correct command to use for the software package. The other options are incorrect because they either compress files (bzip2 -z), unzip files that are compressed with the zip format (unzip -v or funzip), or have the wrong options (-v or -z instead of -d). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, page 353.

asked 02/10/2024
Aldrin Advincula
27 questions

Question 38

Report
Export
Collapse

A Linux administrator is troubleshooting SSH connection issues from one of the workstations.

When users attempt to log in from the workstation to a server with the IP address 104.21.75.76, they receive the following message:

CompTIA XK0-005 image Question 38 99679 10022024175436000000

The administrator reviews the information below:

CompTIA XK0-005 image Question 38 99679 10022024175436000000

CompTIA XK0-005 image Question 38 99679 10022024175436000000

Which of the following is causing the connectivity issue?

The workstation has the wrong IP settings.
The workstation has the wrong IP settings.
The sshd service is disabled.
The sshd service is disabled.
The server's firewall is preventing connections from being made.
The server's firewall is preventing connections from being made.
The server has an incorrect default gateway configuration.
The server has an incorrect default gateway configuration.
Suggested answer: C

Explanation:

The server's firewall is preventing connections from being made, which is causing the connectivity issue. The output of iptables -L -n shows that the firewall is blocking all incoming traffic on port 22, which is the default port for SSH. The output of ssh -v [email protected] shows that the connection is refused by the server. To resolve the issue, the administrator needs to allow port 22 on the firewall.

The other options are incorrect because they are not supported by the outputs. The workstation has the correct IP settings, as shown by the output of ip addr show. The sshd service is enabled and running, as shown by the output of systemctl status sshd. The server has the correct default gateway configuration, as shown by the output of ip route show. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, pages 406-407.

asked 02/10/2024
Fernando Pereira dos Santos
39 questions

Question 39

Report
Export
Collapse

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 rotated files in /var/log without recursion.

INSTRUCTIONS 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.


CompTIA XK0-005 image Question 39 99680 10022024055436000
Correct answer: CompTIA XK0-005 image answer Question 39 99680 10022024055436000

Explanation:


asked 02/10/2024
aaron black
34 questions

Question 40

Report
Export
Collapse

Which of the following files holds the system configuration for journal when running systemd?

/etc/systemd/journald.conf
/etc/systemd/journald.conf
/etc/systemd/systemd-journalctl.conf
/etc/systemd/systemd-journalctl.conf
/usr/lib/systemd/journalctl.conf
/usr/lib/systemd/journalctl.conf
/etc/systemd/systemd-journald.conf
/etc/systemd/systemd-journald.conf
Suggested answer: A

Explanation:

The file that holds the system configuration for journal when running systemd is /etc/systemd/journald.conf. This file contains various settings that control the behavior of the journald daemon, which is responsible for collecting and storing log messages from various sources.

The journald.conf file can be edited to change the default values of these settings, such as the storage location, size limits, compression, and forwarding options of the journal files. The file also supports a drop-in directory /etc/systemd/journald.conf.d/ where additional configuration files can be placed to override or extend the main file. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; journald.conf(5) - Linux manual page

asked 02/10/2024
Karesa Potts
28 questions
Total 397 questions
Go to page: of 40
Search

Related questions