exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 221 discussion

Actual exam question from CompTIA's XK0-005
Question #: 221
Topic #: 1
[All XK0-005 Questions]

A Linux user is trying to execute commands with sudo but is receiving the following error:

$ sudo visudo
>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting

The following output is provided:

# grep root /etc/shadow
root:*LOCK*:14600::::::

Which of the following actions will resolve this issue?

  • A. Log in directly using the root account and comment out line 28 from /etc/sudoers.
  • B. Boot the system in single user mode and comment out line 28 from /etc/sudoers.
  • C. Comment out line 28 from /etc/sudoers and try to use sudo again.
  • D. Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
makuziker
Highly Voted 8 months, 3 weeks ago
Selected Answer: B
So the root login is administratively locked. With *LOCK* in the password field, it means that nobody can log into the system as root user using a password. If the root account was configured for other authentication methods, like SSH keys or certificates, they could do so that way. That alone would not prevent regular users the ability to run "sudo", if they are configured properly in /etc/sudoers. That is because "sudo" uses the user's password, not the root password. But, the sudoers file is misconfigured, maybe someone tried editing it directly with "vim" rather than "visudo" and broke it. Now it seems that nobody can perform sudo and nobody can log in as root (thus, no permission to fix the sudoers file). A good course of action is to boot into single user mode, which would allow root access to a simplified system without a password, and fix the syntax error.
upvoted 9 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago