Working on an Ubuntu Server 14.04.3: After a modification to the /etc/sudoers file, I actually accidently broke it. Unfortunately before i could undo my changes, i lost the SSH connection and thus my shell with elevated access. After logging back into the machine, i could not execute the sudo command anymore, thus i also could not modify the /etc/sudoers file anymore to fix it! Daaaarn!
>>> /etc/sudoers: syntax error near line 32 <<<
sudo: parse error in /etc/sudoers near line 32
sudo: no valid sudoers sources found, quitting
As physical access was no option in this case, the solution to fix this is to use pfexec and the visudo command. As long as there is at least one user in the admin group that you know the password of, you can use:
This will enable you to chose and authenticate as a admin user and modify the sudoers file back into a working state!
Code: Select all