Which of the following protocols is designed to access the video card output of a virtual machine?
Correct Answer: A
Question 98
Which file lists which users can execute commands using sudo? (Specify the full name of the file, including path.)
Correct Answer:
etcsudoers Explanation: The /etc/sudoers file lists which users can execute commands using sudo, as well as which commands they can run, on which hosts, and as which users. The /etc/sudoers file is the main configuration file for the sudo command, which allows users to run commands as another user, usually the superuser or root. The /etc/sudoers file has a specific syntax and should be edited only with the visudo command, which checks the file for errors and locks it to prevent concurrent edits. The /etc/sudoers file contains entries that follow the format: user host = (runas) command where user is the name of the user who can run sudo, host is the name of the host where the user can run sudo, runas is the name of the user as whom the command will be executed, and command is the name of the command or a list of commands that the user can run with sudo. For example, the entry: alice ALL = (root) /bin/ls, /usr/bin/whoami means that the user alice can run sudo on any host, and can execute the commands /bin/ls and /usr/bin/whoami as the root user. The /etc/sudoers file also supports aliases, variables, wildcards, and other features that make it more flexible and powerful. For more details, see the sudoers manual page. Reference: LPIC-1 Exam 102 Objectives, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Weight: 2, Key Knowledge Areas: Configure sudo and sudoers. Use sudo to execute commands as another user. LPIC-1 Exam 102 Learning Materials, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Section 110.2.1: sudo and sudoers, Page 3-5.
Question 99
Which of the following commands preloads and manages keys that are used for automatic authentication while logging in to other machines using SSH?
Correct Answer: B
The ssh-agent command is a program that runs in the background and acts as a key manager for SSH. It can store multiple private keys in memory and provide them to SSH clients when needed. This way, the user does not have to enter the passphrase for each key every time they log in to another machine using SSH. The ssh-agent can also forward the authentication request toanother agent running on the original machine, allowing the user to hop between different machines without re-entering the passphrase1. To use ssh-agent, the user needs to start it and add the private keys to it using the ssh-add command. The ssh-add command can also list, delete, and lock the keys stored in the agent. Theuser can then use the SSH_AUTH_SOCK environment variable to connect to the agent and use the keys for authentication2. The other commands are not related to the ssh-agent. The sshd command is the SSH server daemon that listens for incoming connections and handles the authentication and encryption. The ssh-keygen command is a tool for generating, managing, and converting SSH keys. The ssh command is the SSH client that initiates the connection to the remote machine3. References: 1: SSH Essentials: Working with SSH Servers, Clients, and Keys. 2: [ssh-agent(1) - Linux manual page]. 3: SSH command usage, options, and configuration in Linux/Unix.
Question 100
What output will the following command sequence produce? echo '1 2 3 4 5 6' | while read a b c; do echo result: $c $b $a; done
Correct Answer: E
The while loop reads a line from the standard input and splits it into words using the IFS variable, which by default contains spaces, tabs, and newlines. The read command assigns the first word to the variable a, the second word to the variable b, and the rest of the line to the variable c. Therefore, in this case, a=1, b=2, and c=3 4 5 6. The echo command prints the values of c, b, and a in reverse order, separated by spaces. The output is result: 3 2 1. The loop terminates after reading the first line, since there is no more input to read. Reference: Bash while Loop | Linuxize, Bash Scripting - While Loop - GeeksforGeeks