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

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

List of questions

Question 231

Report
Export
Collapse

A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch. Which of following should the administrator use to meet this requirement?

clone
clone
gitxgnore
gitxgnore
get
get
.ssh
.ssh
Suggested answer: B

Explanation:

To prevent certain files from being tracked by Git, the administrator can use a.gitignorefile (B) in the repository. The.gitignorefile can specify patterns of files or directories that Git should ignore. This way, the Terraform state files will not appear in the main branch or any other branch. The other commands are not related to this requirement.Reference:

[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Ignoring Files with .gitignore

[How to Use .gitignore File]

asked 02/10/2024
Aline Oliveira
40 questions

Question 232

Report
Export
Collapse

A junior administrator updated the PostgreSQL service unit file per the data-base administrator's recommendation. The service has been restarted, but changes have not been applied. Which of the following should the administrator run for the changes to take effect?

Systemct1 get---default
Systemct1 get---default
systemct1 daemon---reload
systemct1 daemon---reload
systemct1 enable postgresq1
systemct1 enable postgresq1
systemct1 mask postgresq1
systemct1 mask postgresq1
Suggested answer: B

Explanation:

To apply changes to a systemd service unit file, the administrator needs to reload the systemd daemon using the commandsystemct1 daemon-reload(B). This will make systemd aware of the new or changed unit files. The other commands will not reload the systemd daemon or apply the changes.Reference:

[CompTIA Linux+ Study Guide], Chapter 7: Managing System Services, Section: Modifying Systemd Services

[How to Reload Systemd Services]

asked 02/10/2024
Trevore Agee
25 questions

Question 233

Report
Export
Collapse

A developer needs to launch an Nginx image container, name it Web001, and ex-pose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

docker exec ---it -p 8080: 80 ------name Web001 nginx
docker exec ---it -p 8080: 80 ------name Web001 nginx
docker load -it -p 8080:80 ------name Web001 nginx
docker load -it -p 8080:80 ------name Web001 nginx
docker run -it -P 8080:80 ------name Web001 nginx
docker run -it -P 8080:80 ------name Web001 nginx
docker pull -it -p 8080:80 ---name Web00l nginx
docker pull -it -p 8080:80 ---name Web00l nginx
Suggested answer: C

Explanation:

To launch an Nginx image container, name it Web001, and expose port 8080 externally while mapping to port 80 inside the container, the administrator can use the commanddocker run -it -p 8080:80 --name Web001 nginx. This will create and start a new container from the Nginx image, assign it a name of Web001, and map port 8080 on the host to port 80 on the container. The other commands are not valid or do not meet the requirements.Reference:

[CompTIA Linux+ Study Guide], Chapter 11: Working with Containers, Section: Running Containers with Docker

[How to Run Docker Containers]

asked 02/10/2024
GLAUCIA C N SILVA
41 questions

Question 234

Report
Export
Collapse

A junior developer is unable to access an application server and receives the following output:

CompTIA XK0-005 image Question 234 99875 10022024175436000000

The systems administrator investigates the issue and receives the following output:

CompTIA XK0-005 image Question 234 99875 10022024175436000000

Which of the following commands will help unlock the account?

Pam_tally2 --user=dev2 ----quiet
Pam_tally2 --user=dev2 ----quiet
pam_ tally2 --user=dev2
pam_ tally2 --user=dev2
pam_tally2 ---user+dev2 ----quiet
pam_tally2 ---user+dev2 ----quiet
pam_tally2 --user=dev2 ----reset
pam_tally2 --user=dev2 ----reset
Suggested answer: D

Explanation:

To unlock an account that has been locked due to login failures, the administrator can use the commandpam_tally2 --user=dev2 --reset(D). This will reset the failure counter for the user ''dev2'' and allow the user to log in again. The other commands will not unlock the account, but either display or increase the failure count.Reference:

[CompTIA Linux+ Study Guide], Chapter 4: Managing Users and Groups, Section: Locking Accounts with pam_tally2

[How to Lock and Unlock User Account in Linux]

asked 02/10/2024
Amin Dashti
51 questions

Question 235

Report
Export
Collapse

A systems administrator wants to delete app . conf from a Git repository. Which of the following commands will delete the file?

git tag app. conf
git tag app. conf
git commit app . conf
git commit app . conf
git checkout app . conf
git checkout app . conf
git rm app. conf
git rm app. conf
Suggested answer: D

Explanation:

To delete a file from a Git repository, the administrator can use the commandgit rm app.conf(D). This will remove the file ''app.conf'' from the working directory and stage it for deletion from the repository. The administrator can then commit the change withgit commit -m 'Delete app.conf'to finalize the deletion. The other commands will not delete the file, but either tag, commit, or checkout the file.Reference:

[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Deleting Files with Git

[How to Delete Files from Git]

asked 02/10/2024
P. Kriek
40 questions

Question 236

Report
Export
Collapse

A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accom-plish this task?

fetch
fetch
checkout
checkout
clone
clone
branch
branch
Suggested answer: C

Explanation:

To retrieve the scripts from a repository and make them available on a local workstation, the junior Linux administrator can use the commandgit clone. This will create a copy of the repository on the local machine, including all the scripts and history. The other commands will not clone the repository, but either fetch, checkout, or branch from an existing repository.Reference:

[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Cloning Repositories with Git

[How to Clone a Git Repository]

asked 02/10/2024
marco damone
41 questions

Question 237

Report
Export
Collapse

A DevOps engineer wants to allow the same Kubernetes container configurations to be deployed in development, testing, and production environments. A key requirement is that the containers should be configured so that developers do not have to statically configure custom, environment-specific locations. Which of the following should the engineer use to meet this requirement?

Custom scheduler
Custom scheduler
Node affinity
Node affinity
Overlay network
Overlay network
Ambassador container
Ambassador container
Suggested answer: D

Explanation:

To allow the same Kubernetes container configurations to be deployed in different environments without statically configuring custom locations, the engineer can use an ambassador container (D). An ambassador container is a proxy container that handles communication between containers and external services. It can dynamically configure locations based on environment variables or other methods. The other options are not related to this requirement.Reference:

[CompTIA Linux+ Study Guide], Chapter 11: Working with Containers, Section: Using Ambassador Containers

[How to Use Ambassador Containers]

asked 02/10/2024
Aaron Ford Jr
46 questions

Question 238

Report
Export
Collapse

A non-privileged user is attempting to use commands that require elevated account permissions, but the commands are not successful. Which of the following most likely needs to be updated?

/etc/passwd
/etc/passwd
/etc/shadow
/etc/shadow
/etc/sudoers
/etc/sudoers
/etc/bashrc
/etc/bashrc
Suggested answer: C

Explanation:

The /etc/sudoers file is used to configure the sudo command, which allows non-privileged users to execute commands that require elevated account permissions1. The file contains a list of users and groups that are allowed to use sudo, and the commands they can run with it. The file also defines the security policy for sudo, such as whether a password is required, how long the sudo session lasts, and what environment variables are preserved or reset.

The /etc/passwd file is used to store information about the user accounts on the system, such as their username, user ID, home directory, and login shell. The /etc/shadow file is used to store the encrypted passwords for the user accounts, along with other information such as password expiration and aging. These files are not directly related to the sudo command, and updating them will not grant a user elevated account permissions.

The /etc/bashrc file is used to set up the environment for the bash shell, such as aliases, functions, variables, and options. This file is executed whenever a new bash shell is started, and it affects all users on the system. However, this file does not control the sudo command or its configuration, and updating it will not allow a user to use commands that require elevated account permissions.

asked 02/10/2024
Lucie Loisel
39 questions

Question 239

Report
Export
Collapse

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER [email protected]

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ['echo','Image created']

The developer must use this information to create a test bed environment and identify the image (myimage) as the first version for testing a new application before moving it to production. Which of the following commands will accomplish this task?

docker build -t myimage:1.0 .
docker build -t myimage:1.0 .
docker build -t myimage: .
docker build -t myimage: .
docker build -t myimage-1.0 .
docker build -t myimage-1.0 .
docker build -i myimage:1.0 .
docker build -i myimage:1.0 .
Suggested answer: A

Explanation:

The docker build command is used to build an image from a Dockerfile and a context1.The Dockerfile is a text file that contains the instructions for creating the image, and the context is a set of files that can be used in the image creation process1. The file that the developer received is an example of a Dockerfile.

The -t option is used to specify a name and an optional tag for the image1.The name and tag are separated by a colon (:), and the tag is usually used to indicate the version of the image2. For example, -t myimage:1.0 means that the image will be named myimage and tagged as 1.0.

The last argument of the docker build command is the path to the context, which can be a local directory or a URL1.The dot (.) means that the current working directory is the context2. Therefore, docker build -t myimage:1.0 . means that the image will be built from the Dockerfile and the files in the current working directory, and it will be named myimage and tagged as 1.0.

asked 02/10/2024
Peter Lilley
49 questions

Question 240

Report
Export
Collapse

An administrator thinks that a package was installed using a snap. Which of the following commands can the administrator use to verify this information?

snap list
snap list
snap find
snap find
snap install
snap install
snap try
snap try
Suggested answer: A

Explanation:

The snap list command is used to display the installed snaps on the system1.Snaps are self-contained software packages that can be installed and updated across different Linux distributions2.The snap list command shows the name, version, revision, developer and notes of each snap1.

The snap find command is used to search for snaps in the Snap Store, which is an online repository of snaps2.The snap install command is used to install snaps from the Snap Store or from a local file2.The snap try command is used to test a snap without installing it, by mounting a directory that contains the snap files2. These commands are not useful for verifying if a package was installed using a snap.

asked 02/10/2024
Maurice Daly
37 questions
Total 397 questions
Go to page: of 40
Search

Related questions