sudo does not work.
I have installed Arch onto a USB key, using BTRFS.
The output of "sudo" is:
$ sudo
sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
$ ls -l /etc/sudoers
-r--r----- 1 root root 2849 May 18 15:00 /etc/sudoers
$ lsattr /etc/sudoers
--------------- /etc/sudoers
$ strace -u ross sudo true
Why might sudo chmod -R a+w * cause
sudo: /etc/sudoers is mode 0640, should be 0440 sudo:
no valid sudoers sources found, quitting
and how might it be made to work?
I have changed the permissions of some system folders and now when i want to install a program it shows this error:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Any help?
I kinda screwed up the /etc directory by running:
sudo chmod 417 /etc
Leaving me unable to use sudo:
sudo: can't open /etc/sudoers: permission denied.
sudo: no valid sudoers sources foundm quitting
Ive been trying to fix it via recovery mode but i'm not sure to what mode I should set it.
(I know sudoers is 0440, but this doesnt fix it because /etc is still messed up.)
Oh and for the future
I have several servers where some users require to be sudoers to work. The problem is that when sudoers can run the command sudo su and login as user root. It seems very risky to run that command.
I tried with Command Alias in the file /etc/sudoers but it has not worked.
Is there any way that they are sudoers but not run the command sudo su?
Tried a million things but I can't restore my root access.
ubuntu@ip-10-252-139-101:~$ sudo su
sudo: /etc/sudoers is owned by uid 1000, should be 0
sudo: no valid sudoers sources found, quitting
Sadly I can't boot in restore mode because this is an AWS EC2 instance, I'm afraid I've screwed everything.
I need to sudo for one last time to start mysql service then dump a database.
I would like to run a command with temporary group membership but it seems that I don't have permission to do that.
the sysadmins are present in the sudoers files of all environments, but other sudoers are not. Different environments all have slightly different sudoers.
i screwed up big time.