ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











What is the main objective when using Application Control?

A.
To filter out specific content.
A.
To filter out specific content.
Answers
B.
To assist the firewall blade with handling traffic.
B.
To assist the firewall blade with handling traffic.
Answers
C.
To see what users are doing.
C.
To see what users are doing.
Answers
D.
Ensure security and privacy of information.
D.
Ensure security and privacy of information.
Answers
Suggested answer: D

Explanation:

The main objective when using Application Control is to ensure the security and privacy of information. Application Control is a security practice that blocks or restricts unauthorized applications from executing in ways that put data at risk. The control functions vary based on the business purpose of the specific application, but the main objective is to help ensure the privacy and security of data used by and transmitted between applications1. Application Control can also prevent malware, untrusted, or unwanted applications from running on the network, reducing the risks and costs associated with data breaches1. Application Control can also improve the overall network stability and performance by eliminating unnecessary or harmful applications1.

Application Control is not mainly used to filter out specific content, although it can be combined with other technologies such as URL filtering or content filtering to achieve that goal. Application Control is not mainly used to assist the firewall blade with handling traffic, although it can be integrated with firewall policies to enforce granular access rules based on applications. Application Control is not mainly used to see what users are doing, although it can provide visibility and reporting on application usage and activity.

A Linux administrator reviews a set of log output files and needs to identify files that contain any occurrence of the word denied. All log files containing entries in uppercase or lowercase letters should be included in the list. Which of the following commands should the administrator use to accomplish this task?

A.
find . -type f -print | xrags grep -ln denied
A.
find . -type f -print | xrags grep -ln denied
Answers
B.
find . -type f -print | xrags grep -nv denied
B.
find . -type f -print | xrags grep -nv denied
Answers
C.
find . -type f -print | xrags grep -wL denied
C.
find . -type f -print | xrags grep -wL denied
Answers
D.
find . -type f -print | xrags grep -li denied
D.
find . -type f -print | xrags grep -li denied
Answers
Suggested answer: D

Explanation:

The command find . -type f -print | xargs grep -li denied will accomplish the task of identifying files that contain any occurrence of the word denied. The find command is a tool for searching for files and directories on Linux systems. The . is the starting point of the search, which means the current directory. The -type f option specifies the type of the file, which means regular file. The -print option prints the full file name on the standard output. The | is a pipe symbol that redirects the output of one command to the input of another command. The xargs command is a tool for building and executing commands from standard input. The grep command is a tool for searching for patterns in files or input. The -li option specifies the flags that the grep command should apply. The -l flag shows only the file names that match the pattern, instead of the matching lines. The -i flag ignores the case of the pattern, which means it matches both uppercase and lowercase letters. The denied is the pattern that the grep command should search for. The command find . -type f -print | xargs grep -li denied will find all the regular files in the current directory and its subdirectories, and then search for any occurrence of the word denied in those files, ignoring the case, and print only the file names that match the pattern. This will allow the administrator to identify files that contain any occurrence of the word denied. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not ignore the case of the pattern (find . -type f -print | xargs grep -ln denied or find . -type f -print | xargs grep -wL denied) or do not show the file names that match the pattern (find . -type f -print | xargs grep -nv denied). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 16: Managing Logging and Monitoring, page 489.

A Linux administrator is installing a web server and needs to check whether web traffic has already been allowed through the firewall. Which of the following commands should the administrator use to accomplish this task?

A.
firewalld query-service-http
A.
firewalld query-service-http
Answers
B.
firewall-cmd --check-service http
B.
firewall-cmd --check-service http
Answers
C.
firewall-cmd --query-service http
C.
firewall-cmd --query-service http
Answers
D.
firewalld --check-service http
D.
firewalld --check-service http
Answers
Suggested answer: C

Explanation:

The command firewall-cmd --query-service http will accomplish the task of checking whether web traffic has already been allowed through the firewall. 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 --query-service http option queries whether a service is enabled in a zone. The http is the name of the service that the command should check. The http service represents the web traffic that uses the port 80 and the TCP protocol. The command firewallcmd

--query-service http will check whether the http service is enabled in the default zone, which is usually the public zone. The command will return yes if the web traffic has already been allowed through the firewall, or no if the web traffic has not been allowed through the firewall. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not exist (firewalld query-service-http or firewalld --check-service http) or do not query the service (firewall-cmd --check-service http instead of firewall-cmd --query-service http). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 392.

A systems administrator wants to permit access temporarily to an application running on port 1234/TCP on a Linux server. Which of the following commands will permit this traffic?

A.
firewall-cmd ---new-service=1234/tcp
A.
firewall-cmd ---new-service=1234/tcp
Answers
B.
firewall-cmd ---service=1234 ---protocol=tcp
B.
firewall-cmd ---service=1234 ---protocol=tcp
Answers
C.
firewall-cmd ---add---port=1234/tcp
C.
firewall-cmd ---add---port=1234/tcp
Answers
D.
firewall-cmd ---add-whitelist-uid=1234
D.
firewall-cmd ---add-whitelist-uid=1234
Answers
Suggested answer: C

Explanation:

Thefirewall-cmdcommand is used to manage firewalld, which is a firewall service for Linux systems that provides dynamic and persistent configuration of firewall rules. Firewalld uses zones and services to define different levels of trust and access for network connections.

To permit access temporarily to an application running on port 1234/TCP on a Linux server, the systems administrator can use thefirewall-cmd --add-port=1234/tcpcommand. This command will add a rule to the default zone (usually public) that allows incoming traffic on port 1234/TCP. The rule will only be effective until the next reload or restart of firewalld. To make the rule permanent, the administrator can add the--permanentoption to the command. The statement C is correct.

The statements A, B, and D are incorrect because they do not permit access to port 1234/TCP. Thefirewall-cmd --new-service=1234/tcpcommand does not exist. Thefirewall-cmd --service=1234 --protocol=tcpcommand does not work because 1234 is not a predefined service name in firewalld. Thefirewall-cmd --add-whitelist-uid=1234command does not exist.Reference: [How to Use FirewallD to Manage Firewall in Linux]

The development team wants to prevent a file from being modified by all users in a Linux system, including the root account. Which of the following commands can be used to accomplish this objective?

A.
chmod / app/conf/file
A.
chmod / app/conf/file
Answers
B.
setenforce / app/ conf/ file
B.
setenforce / app/ conf/ file
Answers
C.
chattr +i /app/conf/file
C.
chattr +i /app/conf/file
Answers
D.
chmod 0000 /app/conf/file
D.
chmod 0000 /app/conf/file
Answers
Suggested answer: C

Explanation:

Thechattrcommand is used to change file attributes on Linux systems that support extended attributes, such as ext2, ext3, ext4, btrfs, xfs, and others. File attributes are flags that modify the behavior of files and directories.

To prevent a file from being modified by all users in a Linux system, including the root account, the development team can use thechattr +i /app/conf/filecommand. This command will set the immutable attribute (+i) on the file/app/conf/file, which means that the file cannot be deleted, renamed, linked, appended, or written to by any user or process. To remove the immutable attribute, the development team can use thechattr -i /app/conf/filecommand. The statement C is correct.

The statements A, B, and D are incorrect because they do not prevent the file from being modified by all users. Thechmod /app/conf/filecommand does not work because it requires an argument to specify the permissions to change. Thesetenforce /app/conf/filecommand does not work because it is used to change the SELinux mode, not file attributes. Thechmod 0000 /app/conf/filecommand will remove all permissions from the file, but it can still be modified by the root account.Reference: [How to Use chattr Command in Linux]

The development team wants to prevent a file from being modified by all users in a Linux system, including the root account. Which of the following commands can be used to accomplish this objective?

A.
chmod / app/conf/file
A.
chmod / app/conf/file
Answers
B.
setenforce / app/ conf/ file
B.
setenforce / app/ conf/ file
Answers
C.
chattr +i /app/conf/file
C.
chattr +i /app/conf/file
Answers
D.
chmod 0000 /app/conf/file
D.
chmod 0000 /app/conf/file
Answers
Suggested answer: C

Explanation:

Thechattrcommand is used to change file attributes on Linux systems that support extended attributes, such as ext2, ext3, ext4, btrfs, xfs, and others. File attributes are flags that modify the behavior of files and directories.

To prevent a file from being modified by all users in a Linux system, including the root account, the development team can use thechattr +i /app/conf/filecommand. This command will set the immutable attribute (+i) on the file/app/conf/file, which means that the file cannot be deleted, renamed, linked, appended, or written to by any user or process. To remove the immutable attribute, the development team can use thechattr -i /app/conf/filecommand. The statement C is correct.

The statements A, B, and D are incorrect because they do not prevent the file from being modified by all users. Thechmod /app/conf/filecommand does not work because it requires an argument to specify the permissions to change. Thesetenforce /app/conf/filecommand does not work because it is used to change the SELinux mode, not file attributes. Thechmod 0000 /app/conf/filecommand will remove all permissions from the file, but it can still be modified by the root account.Reference: [How to Use chattr Command in Linux]

An administrator would like to securely connect to a server and forward port 8080 on a local machine to port 80 on the server. Which of the following commands should the administrator use to satisfy both requirements?

A.
ssh ---L 8080: localhost:80 admin@server
A.
ssh ---L 8080: localhost:80 admin@server
Answers
B.
ssh ---R 8080: localhost:80 admin@server
B.
ssh ---R 8080: localhost:80 admin@server
Answers
C.
ssh ---L 80 : localhost:8080 admin@server
C.
ssh ---L 80 : localhost:8080 admin@server
Answers
D.
ssh ---R 80 : localhost:8080 admin@server
D.
ssh ---R 80 : localhost:8080 admin@server
Answers
Suggested answer: A

Explanation:

This command will create a local port forwarding, which means that connections from the SSH client are forwarded via the SSH server, then to a destination server. In this case, the destination server is the same as the SSH server (localhost), and the destination port is 80. The SSH client will listen on port 8080 on the local machine, and any connection to that port will be forwarded to port 80 on the server. This way, the administrator can securely access the web service running on port 80 on the server by using http://localhost:8080 on the local machine.

The other options are incorrect because:

B) ssh -R 8080:localhost:80 admin@server

This command will create a remote port forwarding, which means that connections from the SSH server are forwarded via the SSH client, then to a destination server. In this case, the destination server is the same as the SSH client (localhost), and the destination port is 80. The SSH server will listen on port 8080 on the remote machine, and any connection to that port will be forwarded to port 80 on the client. This is not what the administrator wants to do.

C) ssh -L 80:localhost:8080 admin@server

This command will also create a local port forwarding, but it will use port 80 on the local machine and port 8080 on the server. This is not what the administrator wants to do, and it may also fail if port 80 is already in use by another service on the local machine.

D) ssh -R admin@server

This command is incomplete and invalid. It does not specify any port numbers or destination addresses for the remote port forwarding. It will also fail if the SSH server does not allow remote port forwarding.

CompTIA Linux+ Certification Exam Objectives

How to Set up SSH Tunneling (Port Forwarding)

An engineer needs to insert a character at the end of the current line in the vi text editor. Which of the following will allow the engineer to complete this task?

A.
p
A.
p
Answers
B.
r
B.
r
Answers
C.
bb
C.
bb
Answers
D.
A
D.
A
Answers
E.
i
E.
i
Answers
Suggested answer: D

Explanation:

The vi text editor is a popular and powerful tool for editing text files on Linux systems. The vi editor has two modes: command mode and insert mode. In command mode, the user can issue commands to manipulate the text, such as moving the cursor, deleting, copying, pasting, searching, replacing, and saving. In insert mode, the user can type text into the file. To switch from command mode to insert mode, the user can press various keys, such as i, a, o, I, A, or O. To switch from insert mode to command mode, the user can press the Esc key.

To insert a character at the end of the current line in the vi editor, the user can press the A key in command mode. This will move the cursor to the end of the line and switch to insert mode. Then, the user can type the desired character and press Esc to return to command mode. The statement D is correct.

The statements A, B, C, and E are incorrect because they do not perform the desired task. The p key in command mode will paste the previously copied or deleted text after the cursor. The r key in command mode will replace the character under the cursor with another character. The bb key in command mode will move the cursor back two words. The i key in command mode will switch to insert mode before the cursor.Reference: [How to Use vi Text Editor in Linux]

Which of the following specifications is used to perform disk encryption in a Linux system?

A.
LUKS
A.
LUKS
Answers
B.
TLS
B.
TLS
Answers
C.
SSL
C.
SSL
Answers
D.
NFS
D.
NFS
Answers
Suggested answer: A

Explanation:

LUKS stands for Linux Unified Key Setup, which is a specification for disk encryption on Linux systems. LUKS allows users to encrypt partitions or entire disks using a passphrase or a key file. LUKS also supports multiple keys and key slots, which can be used to unlock the encrypted data. LUKS is compatible with various tools and utilities, such as cryptsetup, dm-crypt, and LVM.Reference: [How to Encrypt Partitions with LUKS on Linux]

As part of the requirements for installing a new application, the swappiness parameter needs to be changed to O. This change needs to persist across re-boots and be applied immediately. A Linux systems administrator is performing this change. Which of the following steps should the administrator complete to accomplish this task?

A.
echo 'vm. swappiness---()' >> /etc/sysctl . conf && sysctl ---p
A.
echo 'vm. swappiness---()' >> /etc/sysctl . conf && sysctl ---p
Answers
B.
echo 'vrn. >> / proc/meminfo && sysctl ---a
B.
echo 'vrn. >> / proc/meminfo && sysctl ---a
Answers
C.
sysctl ---v >> / proc/meminfo & & echo 'vm. swapiness=0'
C.
sysctl ---v >> / proc/meminfo & & echo 'vm. swapiness=0'
Answers
D.
sysctl ---h 'vm. swapiness---O' && echo / etc/vmswapiness
D.
sysctl ---h 'vm. swapiness---O' && echo / etc/vmswapiness
Answers
Suggested answer: A

Explanation:

To change the swappiness parameter to 0 and make it persistent across reboots and applied immediately, the administrator can perform the following steps:

Append the linevm.swappiness=0to the file/etc/sysctl.confusingecho 'vm.swappiness=0' >> /etc/sysctl.conf(A). This will set the swappiness parameter to 0 for future boots.

Reload the sysctl configuration usingsysctl -p(A). This will apply the changes to the current system without rebooting. The other commands will not achieve this task, but either write to a wrong file, use a wrong option, or have a syntax error.Reference:

[CompTIA Linux+ Study Guide], Chapter 8: Optimizing Linux Performance, Section: Tuning Kernel Parameters with sysctl

[How to Change Swappiness in Linux]

Total 371 questions
Go to page: of 38