CompTIA XK0-005 Practice Test - Questions Answers, Page 36
List of questions
Related questions
A security analyst is monitoring the network to identify latency or slowdowns during a vulnerability scan.
bash
function x() {
info=$(ping -c 1 $1 | awk -F '/' 'END {print $5}')
echo '$1 | $info'
}
Which of the following functions will best achieve this?
function x() { info=$(dig $(dig -x $1 | grep ptr | tail -n 1 | awk -F '.in-addr' '{print $1}').origin.asn.cymru.com TXT +short); echo '$1 | $info' }
function x() { info=$(ping -c 1 $1 | awk -F '/' 'END {print $5}'); echo '$1 | $info' }
function x() { info=$(nc -m 40 $1 | awk 'END {print $1}'); echo '$1 | $info' }
function x() { info=$(geoiplookup $1); echo '$1 | $info' }
A Linux administrator needs to remove all local firewall rules on a Linux system. Which of the following commands should the administrator run?
iptables -D
iptables -L
iptables -F
iptables -A
Which of the following will prevent non-root SSH access to a Linux server?
Creating the /etc/nologin file
Creating the /etc/nologin.allow file containing only a single line root
Creating the /etc/nologin/login.deny file containing a single line -all
Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so
A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?
file filename
touch filename
grep filename
lsof filename
A Linux administrator is implementing a stateful firewall on the Linux server. Which of the following iptables options will be required to build the stateful rules? (Select two).
--name established
-m recent
-m conntrack
--state
--remove
-j DROP
An administrator is troubleshooting a database service outage that was reported by a monitoring system. Given the following output:
$ systemctl status mariadb
Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL
Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Failed with result 'signal'.
Oct 20 16:40:50 comptia systemd[1]: Stopped MariaDB 10.3 database server.
$ dmesg
[ 1061.491433] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom, task_memcg=/system.slice/mariadb.service, task=mysqld,pid=1981,uid=27
[ 1061.491453] Out of memory: Killed process 1981 (mysqld) total-vm:330668kB, anon-rss:31316kB, file-rss:OkB, shmem-rss:OkB, UID:27 pgtables:324kB oom_score_adj:0
Which of the following is the reason for the outage?
The administrator sent a kill signal to the database
The server is missing the DMA bus
The database cannot write anything else to the storage
The server does not have enough physical memory
A DevOps engineer pushed the updated configuration to an existing branch of a remote Git repository. Which of the following commands should the Linux administrator use to obtain these configuration changes?
git pull
git log
git fetch
git checkout main
The MySQL database process that was running on a Linux server suddenly stopped, and the process was killed. Which of the following commands can help identify whether this issue was produced by the OOM killer?
grep /proc/oom_score
grep -ir 'out of memory' /var/log
cat /var/run/initramfs/overlayroot.log | grep 'out of memory'
cat /sys/block/loop0/events
After trying to install an RPM package unsuccessfully, a systems administrator verifies the integrity of the package's database. The administrator discovers that the database is corrupted and needs to be recreated. Which of the following commands will help accomplish this task?
rpmdb -D rebuild
rpmdb --initdb
rpmdb --rebuilddb
rpmdb --exportdb
A Linux administrator logs in to a system and identifies that an important backup has been started. The backup process is consuming a considerable amount of CPU time but needs to continue. Which of the following should the administrator use to reduce the impact this process has on other services?
renice -n 15 -p <backup pid>
nice -n 15 -p <backup pid>
renice -n -15 -p <backup pid>
nice -n -15 -p <backup pid>
Question