81-90 Flashcards

1
Q

A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?

A. visudo -c
B. test -f /etc/sudoers
C. sudo vi check
D. cat /etc/sudoers | tee test

A

A. visudo -c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?

A. scp ~/.ssh/id_rsa user@server:~/
B. rsync ~ /.ssh/ user@server:~/
C. ssh-add user server
D. ssh-copy-id user@server

A

D. ssh-copy-id user@server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A Linux administrator created a new file system. Which of the following files must be updated to ensure the filesystem mounts at boot time?

A. /etc/sysctl
B. /etc/filesystems
C. /etc/fstab
D. /etc/nfsmount.conf

A

C. /etc/fstab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands:

$ vmstat -s –unit M

968 M total memory
331 M used memory
482 M active memory
279 M inactive memory
99 M free memory

$ free -h

total|used|free|shared|buff/cache|available

Mem: 968M|331M|95M|13M|540M|458M
Swap: 0|0|0

$ ps -aux | grep script.sh

USER|PID|%CPU|%MEM|VSZ|RSS|TTY|STAT|TIME|COMMAND

user|8321|2.8|40.5|3224846|371687|7|SN|16:49|2:09|/home/user/script.sh

Which of the following commands would address the issue?

A. top -p 8321
B. kill -9 8321
C. renice -10 8321
D. free 8321

A

C. renice -10 8321

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A systems administrator made some unapproved changes prior to leaving the company. The newly hired administrator has been tasked with revealing the system to a compliant state. Which of the following commands will list and remove the correspondent packages?

A. dnf list and dnf remove last
B. dnf remove and dnf check
C. dnf info and dnf upgrade
D. dnf history and dnf history undo last

A

D. dnf history and dnf history undo last

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:

[admin@linux ~ ]$ -ls -lhz .ssh/auth*
-rw-r-r–r–. admin unconfined_u:object_r:user_home_t:s0 .ssh/authorized_keys

Which of the following commands would resolve the issue?

A. restorecon .ssh/authorized_keys
B. ssh_keygen -t rsa -o .ssh/authorized_keys
C. chown root:root .ssh/authorized_keys
D. chmod 600 .ssh/authorized_keys

A

A. restorecon .ssh/authorized_keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?

A. docker images prune -a
B. docker push images -a
C. docker rmi -a images
D. docker images rmi –all

A

A. docker images prune -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A Linux system is failing to boot with the following error:

error: no such partitions
Entering rescue mode…
grub rescue>

Which of the following actions will resolve this issue? (Choose two.)

A. Execute grub-install –root-directory=/mnt and reboot.
B. Execute grub-install /dev/sdX and reboot.
C. Interrupt the boot process in the GRUB menu and add rescue to the kernel line.
D. Fix the partition modifying /etc/default/grub and reboot.
E. Interrupt the boot process in the GRUB menu and add single to the kernel line.
F. Boot the system on a LiveCD/ISO.

A

B. Execute grub-install /dev/sdX and reboot.

D. Fix the partition modifying /etc/default/grub and reboot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A Linux administrator needs to create an image named sda.img from the sda disk and store it in the /tmp directory. Which of the following commands should be used to accomplish this task?

A. dd of=/dev/sda if=/tmp/sda.img
B. dd if=/dev/sda of=/tmp/sda.img
C. dd –if=/dev/sda –of=/tmp/sda.img
D. dd –of=/dev/sda –if=/tmp/sda.img

A

B. dd if=/dev/sda of=/tmp/sda.img

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A Linux administrator is creating a primary partition on the replacement hard drive for an application server. Which of the following commands should the administrator issue to verify the device name of this partition?

A. sudo fdisk /dev/sda
B. sudo fdisk -s /dev/sda
C. sudo fdisk -l
D. sudo fdisk -h

A

C. sudo fdisk -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly