ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 206 - XK0-005 discussion

Report
Export

A Linux administrator is creating a new sudo profile for the accounting user. Which of the following should be added by the administrator to the sudo configuration file so that the accounting user can run / opt/ acc/ report as root?

A.
accounting localhost=/opt/acc/report
Answers
A.
accounting localhost=/opt/acc/report
B.
accounting ALL=/opt/acc/report
Answers
B.
accounting ALL=/opt/acc/report
C.
%accounting ALL=(ALL) NOPASSWD: /opt/acc/report
Answers
C.
%accounting ALL=(ALL) NOPASSWD: /opt/acc/report
D.
accounting /opt/acc/report= (ALL) NOPASSWD: ALL
Answers
D.
accounting /opt/acc/report= (ALL) NOPASSWD: ALL
Suggested answer: C

Explanation:

This answer allows the accounting user to run the /opt/acc/report command as root on any host without entering a password. The % sign indicates that accounting is a group name, not a user name. The ALL keyword means any host, any user, and any command, depending on the context. The NOPASSWD tag overrides the default behavior of sudo, which is to ask for the user's password.

The other answers are incorrect for the following reasons:

A) accounting localhost=/opt/acc/report

This answer only allows the accounting user to run the command on the localhost, not on any host.

This answer also requires the accounting user to enter their password, which is not specified in the question.

B) accounting ALL=/opt/acc/report

This answer only allows the accounting user to run the command as themselves, not as root.

This answer also requires the accounting user to enter their password, which is not specified in the question.

D) accounting /opt/acc/report= (ALL) NOPASSWD: ALL

This answer has an invalid syntax, as there should be no space between the equal sign and the parentheses.

This answer also grants too much privilege to the accounting user, as it allows them to run any command as any user without a password.

asked 02/10/2024
Mark Baker
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first