1-10 Flashcards
An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct version of this file?
A. rpm -qa | grep kernel; uname -a
B. yum -y update; shutdown -r now
C. cat /etc/centos-release; rpm -Uvh –nodeps
D. telinit 1; restorecon -Rv /boot
A. rpm -qa | grep kernel; uname -a
A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?
A. /etc/host.conf
B. /etc/hostname
C. /etc/services
D. /etc/ssh/sshd_config
D. /etc/ssh/sshd_config
A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?
A. git reflog
B. git pull
C. git status
D. git push
B. git pull
A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?
A. iptables -t nat -D PREROUTING -p tcp –sport 80 -j DNAT - -to-destination 192.0.2.25:3128
B. iptables -t nat -A PREROUTING -p top –dport 81 -j DNAT –-to-destination 192.0.2.25:3129
C. iptables -t nat -I PREROUTING -p top –sport 80 -j DNAT –-to-destination 192.0.2.25:3129
D. iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –-to-destination 192.0.2.25:3128
D. iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –-to-destination 192.0.2.25:3128
Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?
A. route -i etho -p add 10.0.213.5 10.0.5.1
B. route modify eth0 +ipv4.routes “10.0.213.5/32 10.0.5.1”
C. echo “10.0.213.5 10.0.5.1 eth0” > /proc/net/route
D. ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0
D. ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0
1/bin/bash
A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given the following:
filename=$1
<CONDITIONAL>
echo "File exists"
else
echo "File does not exist"
fi
Which of the following commands should replace the <CONDITIONAL> string?
A. if [ -f "$filename" ]; then
B. if [ -d "$filename" ]; then
C. if [ -f "$filename" ] then
D. if [ -f "$filename" ]; while
</CONDITIONAL></CONDITIONAL>
A. if [ -f “$filename” ]; then
! /bin/bash
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 related files in /var/log without recursion.
find /var/log -type f -maxdepth 1 | grep “ ? “ > /tmp/temfile “ ? “ filename “ ? “ $(cat “ ? “)
do
“ ? “ $filename
“ ? “
[done] [while] [xz] [pgrep] [locate] [for] [sed] [filename] [until] [tar] [then] [$log] [egrep] [“$log.[1-6]$”] [“log.[1-6]$”] [“$1”] [repeat] [in] [/tmp/tempfile] [/var/log] [zip] [gzip] [rar] [awk] [“$6”]
“log.[1-6]$”
for
in
/tmp/temfile
gzip
done
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:
resource “abc_instance” “ec2_instance” {
ami = data.abc_ami.vendor-Linux-2.id
associate_public_ip_address = true
count = 3
instance_type = “instance_type”
vpc_security_group_ids = [abc.security_group.allow_ssh.id]
Key_name = abc_key_pair.key_pair.key_name
tags = {
Name = “${var.namespace} $(count.index)”
}
}
Which of the following technologies is the administrator using?
A. Ansible
B. Puppet
C. Chef
D. Terraform
D. Terraform
Which of the following technologies can be used as a central repository of Linux users and groups?
A. LDAP
B. MFA
C. SSO
D. PAM
A. LDAP
A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:
ip link list dev eth0
2: etho: <NO-CARRIER, BROADCAST, MULTICAST, UP> mtu 1500, qdisc link/ether ac:00:11:22:33:cd brd ff:ff:ff:ff:ff:ff
Based on the output above, which of following is the MOST probable cause of the issue?
A. The address ac:00:11:22:33:cd is not a valid Ethernet address.
B. The Ethernet broadcast address should be ac:00:11:22:33:ff instead.
C. The network interface eth0 is using an old kernel module.
D. The network interface cable is not connected to a switch.
D. The network interface cable is not connected to a switch.