Bug 415 - chmod on "sudoers" can't be undone
chmod on "sudoers" can't be undone
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudoers
1.8.0
PC Linux
: low high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-07 21:06 MDT by Karl Woelfer
Modified: 2010-07-08 07:02 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Woelfer 2010-07-07 21:06:46 MDT
With admin privileges, changed mode of sudoers file from 440 to 666. Vi edited the file and saved. Cannot change mode back to 0440.

sudo:/etc/sudoers is mode 0666, should be 0440.

I need to recover, i.e. backup to pre-edited sudoers, but how do I proceed? Vi-entered changes are not important.

Thank you,
Karl Woelfer
Comment 1 Todd C. Miller 2010-07-08 07:02:05 MDT
This is why you should use visudo to edit the sudoers file--it will validate the file and make sure the mode is correct.  You'll need to login as root and change the mode of /etc/sudoers to 0440.  Sudo will refuse to run if sudoers has a file mode that is not secure.