i screwed up big time.
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
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
Recently I had to change the folder permissions of /usr folder. Now the whole sudo is not working.
I change permissions the dir /etc , i can't execute sudo ...
sudo output :
Code:
sudo: /etc/sudoers es escribible por todos
sudo: no se encontraron fuentes sudoers válidas, saliendo
sudo: no se puede inicializar la política de plugin
As I can restore the folder with the correct permissions etc?
sorry for my bad English, I speak Spanish.
I am learning Linux for work, so am still a bit rusty on the edges.
I am needing to change the folder permission of folder /opt, and I know in Linux, you do the following:
chmod 775 /opt
I get a message under that saying:
chmod: WARNING: cannot change /opt/: Operation not permitted (error 1).
Does that mean I need SUDO permissions?
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?
When I try to edit my /etc/hostname file, using: sudo nano /etc/hostname (or any other editor) I get the following: Error writing /etc/hostname: Permission denied
I then tried to: sudo chmod u+w ./hostname
and got the error:
chmod: changing permissions of `./hostname': Operation not permitted
I get the same error trying to add write permissions to any use or group.
This is what ls show:
-rw-r--r
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.