PDA

View Full Version : [all variants] [SOLVED] permission /etc/sudoers



mobyu
June 21st, 2008, 06:52 AM
I'm using xubuntu on hardy.
I tryed to change the permission of /etc/sudoers. and I could do that.
But now , I can't undo this operation.



$ sudo chmod 777 /etc/sudoers
$ sudo vi /etc/sudoers
sudo: /etc/sudoers is mode 0777, should be 0440
$ vi /etc/sudoers
$ sudo chmod 440 /etc/sudoers
sudo: /etc/sudoers is mode 0777, should be 0440
$ chmod 440 /etc/sudoers
chmod: changing permissions of `/etc/sudoers': Operation not permitted
$ sudo chmod 440 /etc/sudoers
sudo: /etc/sudoers is mode 0777, should be 0440
$ sudo chmod 0440 /etc/sudoers
sudo: /etc/sudoers is mode 0777, should be 0440
$ chmod 0440 /etc/sudoers
chmod: changing permissions of `/etc/sudoers': Operation not permitted
$ ls -la /etc/sudoers
-rwxrwxrwx 1 root root 501 2008-06-21 14:09 /etc/sudoers

sdennie
June 21st, 2008, 07:14 AM
I think you will probably need to boot into recovery mode from the boot menu and run:



chmod 0440 /etc/sudoers

AndThenWhat
June 21st, 2008, 07:16 AM
Maybe try:


sudo -s -H

and CD'ing into the directory to edit the file(s) ?

mobyu
June 21st, 2008, 10:49 AM
Thanks vor. it's just what I need.
yes,I can do that.I can login recovery mode ,and root shell with no password.