Bugzilla – Bug 415
chmod on "sudoers" can't be undone
Last modified: 2010-07-08 07:02:05 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
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.