Question 131 · 300 in bank
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?
Show answer
Answer: B
Explanation
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.
Source: Adapted from community discussion — makuziker