Which two statements about sudo are correct? (Choose two.)
LPIC-1 Exam 102-500, objective 110. Security hard
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
The options
Choose 2.
Not correct sudo -s starts a login shell that re-reads the target user's login scripts and changes to their home directory.
Wrong; that describes sudo -i. sudo -s runs the target user's shell as a non-login shell, keeping the current working directory and most of the invoking environment.
Correct sudo -i simulates a full login: it starts a login shell, sources the target user's login files and begins in their home directory.
Correct. -i is the initial-login form and is the sudo counterpart of `su -`.
Not correct Rules dropped into /etc/sudoers.d only take effect after running pwconv.
Wrong. pwconv belongs to the shadow suite and migrates password hashes from /etc/passwd into /etc/shadow. It has nothing to do with sudo.
Correct Files placed in /etc/sudoers.d are read because /etc/sudoers contains an includedir directive, so no edit to /etc/sudoers itself is needed.
Correct. The shipped sudoers ends with an include of that directory (written #includedir /etc/sudoers.d, or @includedir in sudo 1.9.1 and later). Note that files whose names contain a dot or end in ~ are deliberately skipped, which quietly breaks drop-ins named like webteam.conf.
Not correct Without -u, sudo runs the command as the invoking user, so -u root is required to gain administrative rights.
Wrong. sudo runs commands as root unless -u names a different target user. Running a command as yourself would make sudo pointless.
Why
sudo's shell forms mirror su's: -i is the login form, -s is not. Configuration is layered: /etc/sudoers holds the base policy and pulls in a directory of drop-in files so that packages and configuration management can add rules without rewriting the main file. Edit either with visudo, which locks and syntax-checks. A sudoers rule reads `user host = (runas) commands`, for example `alice ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart nginx`.
Where this comes from
- Cited
- LPI exam objective 110.1
- What it says
- Grant limited administrative access with sudo, including drop-in configuration files.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 110 and space the ones you get wrong.