Some servers in an organization have been compromised. Users are unable to access to the organization's web page and other services. While reviewing the system log, a systems administrator notices messages from the kernel regarding firewall rules:
Which of the following commands will remediate and help resolve the issue?
A.
B.
C.
D.
Answer : A
The commandiptables -Fwill remediate and help resolve the issue. The issue is caused by the firewall rules that block the access to the organization's web page and other services. The output ofdmesg | grep firewallshows that the kernel has dropped packets from the source IP address 192.168.1.100 to the destination port 80, which is the default port for HTTP. The commandiptables -Fwill flush all the firewall rules and allow the traffic to pass through. This command will resolve the issue and restore the access to the web page and other services. The other options are incorrect because they either do not affect the firewall rules (ip route flushorip addr flush) or do not exist (iptables -R).Reference:CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 543.
A Linux user is trying to execute commands with sudo but is receiving the following error:
$ sudo visudo
>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting
The following output is provided:
# grep root /etc/shadow
root :* LOCK *: 14600 ::::::
Which of the following actions will resolve this issue?
Answer : B
A junior systems administrator recently installed an HBA card in one of the servers that is deployed for a production environment. Which of the following
commands can the administrator use to confirm on which server the card was installed?
Answer : A
The best command to use to confirm on which server the HBA card was installed is A. lspci | egrep 'hba| fibr'. This command will list all the PCI devices on the server and filter the output for those that match the pattern 'hba' or 'fibr', which are likely to be related to the HBA card. The egrep command is a variant of grep that supports extended regular expressions, which allow the use of the '|' operator for alternation. The other commands are either invalid or will not produce the desired output. For example:
B . lspci | zgrep 'hba | fibr' will try to use zgrep, which is a command for searching compressed files, not standard output.
C . lspci | pgrep 'hba| fibr' will try to use pgrep, which is a command for finding processes by name or other attributes, not text patterns.
D . lspci | 'hba | fibr' will try to use 'hba | fibr' as a command, which is not valid and will cause an error.
The journald entries have filled a Linux machine's /var volume. Which of the following is the best command for a systems administrator to use to free up the disk space occupied by these entries?
Answer : B
systemctl stop systemd-journald systemctl start systemd-journald is the best approach among the given options. Stopping and starting the systemd-journald service can help in managing the disk space used by journal logs without manually deleting log files or using more aggressive cleanup methods. This method ensures that log management is handled gracefully by the system's own services.
An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?
Answer : D
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
A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure. Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?
Answer : D
The command that will allow the administrator to determine the first command that is executed inside the container right after it starts is docker inspect <container_id>. This command will display detailed information about the container, including its configuration, state, network settings, mounts, and logs. One of the configuration fields is ''Entrypoint'', which shows the command that is executed when the container is run. The entrypoint can be specified in the Dockerfile or overridden at runtime using the --entrypoint option.
The other options are not correct commands for determining the first command that is executed inside the container. The docker export <container_id> command will export the contents of the container's filesystem as a tar archive to STDOUT. This will not show the entrypoint of the container, but only its files. The docker info <container_id> command is invalid because docker info does not take any arguments. It shows system-wide information about Docker, such as the number of containers, images, volumes, networks, and storage drivers. The docker start <container_id> command will start a stopped container and attach its STDOUT and STDERR to the terminal. This will not show the entrypoint of the container, but only its output.Reference:docker inspect | Docker Docs;docker export | Docker Docs;docker info | Docker Docs;docker start | Docker Docs
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?
Answer : D
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]