ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 253 - XK0-005 discussion

Report
Export

A Linux administrator generated a list of users who have root-level command-line access to the Linux server to meet an audit requirement. The administrator analyzes the following /etc/passwd and /etc/sudoers files:

$ cat /etc/passwd

root:x: 0:0: :/home/root: /bin/bash

lee: x: 500: 500: :/home/lee:/bin/tcsh

mallory:x: 501:501: :/root:/bin/bash

eve:x: 502: 502: /home/eve:/bin/nologin

carl:x:0:503: :/home/carl:/bin/sh

bob:x: 504: 504: : /home/bob:/bin/ksh

alice:x: 505:505: :/home/alice:/bin/rsh

$ cat /etc/sudoers

Cmnd_Alias SHELLS = /bin/tcsh, /bin/sh, /bin/bash

Cmnd_Alias SYSADMIN = /usr/sbin/tcpdump

ALL = (ALL) ALL

ALL = NOPASSWD: SYSADMIN

Which of the following users, in addition to the root user, should be listed in the audit report as having root-level command-line access? (Select two).

A.
Carl
Answers
A.
Carl
B.
Lee
Answers
B.
Lee
C.
Mallory
Answers
C.
Mallory
D.
Eve
Answers
D.
Eve
E.
Bob
Answers
E.
Bob
F.
Alice
Answers
F.
Alice
Suggested answer: A, C

Explanation:

The users who have root-level command-line access are those who have either the same user ID (UID) as root, which is 0, or the ability to run commands as root using sudo. Based on the /etc/passwd and /etc/sudoers files, the users who meet these criteria are:

Carl: Carl has the same UID as root, which is 0, as shown in the /etc/passwd file. This means that Carl can log in as root and execute any command with root privileges1

Mallory: Mallory has the ability to run commands as root using sudo, as shown in the /etc/sudoers file. The line ALL = (ALL) ALL means that any user can run any command as any other user, including root, by using sudo. Mallory can also use the root shell /bin/bash as her login shell, as shown in the /etc/passwd file2

Therefore, the correct answer is A and C. Lee, Eve, Bob, and Alice do not have root-level command-line access because they have different UIDs from root and they cannot use sudo to run commands as root. Lee can only use sudo to run the commands listed in the Cmnd_Alias SHELLS, which are /bin/tcsh, /bin/sh, and /bin/bash. Eve cannot log in at all because her login shell is /bin/nologin. Bob and Alice can only use sudo to run the command /usr/sbin/tcpdump without a password, as specified by the Cmnd_Alias SYSADMIN and the line ALL = NOPASSWD: SYSADMIN2

asked 02/10/2024
Nicos Chamberlain
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first