Ubuntu – Is /etc/sudoers file only suppose to have read only permissions


-r--r-----   1 root root     723 Jan 31  2012 sudoers

My dist-update frequently fails.
At boot my system frequently asks for file system check. (My system-hardware is file)

I am using

vksTP 3.5.0-25-generic #39~precise1-Ubuntu SMP Tue Feb 26 00:07:14 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux

From root prompt, is it safe for me to do (I donot know if that will work, as the file is read only)

chmod g+w /etc/sudors  

my user is added in root group

vks@vksTP:~$ sudo adduser vks root
The user `vks' is already a member of `root'.

Please suggest, I may have superficial knowledge on perms, and I may be confusing things up. Please let me know if there is any other important piece of information I am missing ?

Best Answer

Yes, /etc/sudoers is supposed to have those permissions, being read-only for user and group, nothing else. The reason being that you aren't supposed to edit the sudoers file directly, but by using the visudo wrapper, which provides some sanity checking before writing a new sudoers file.

You can control what editor visudo uses by setting the VISUAL alt. EDITOR environment variable.

$ sudo EDITOR=emacs visudo