visudo killed my suders file

CU

Platinum Member
Aug 14, 2000
2,415
51
91
I tired to use visudo, but nothing happened. So I tried visudo -f /etc/sudoers thinking I needed to give it the file. But now my /etc/suders file is the error output from visudo about a syntax error on line 1. Why would visudo write its error output to /etc/sudoers? It is suppose to write a valid file not a syntax error message. This was with Ubuntu 14.04. Now I get to try and found out how to create a new one.
 
Feb 25, 2011
16,987
1,617
126
Log in as root, use nano to fix it. Or boot from a recovery disk and copy a fresh one over.
 

CU

Platinum Member
Aug 14, 2000
2,415
51
91
I think root is disabled in Ubuntu and I cannot enable it since I can not sudo. But, I think I can fix it in recovery mode or a live CD.
 

CU

Platinum Member
Aug 14, 2000
2,415
51
91
Why isn't it made where if the suders file has a syntax error it reads from a backup of the original file stored somewhere?
 

CU

Platinum Member
Aug 14, 2000
2,415
51
91
Fixed it with pkexec visudo. Didn't even have to go into recovery mode or anything.