Is there a way to fix all permissions of the directory on Fedora?

363 views Asked by At

I accidentally broke the file permissions of /usr using chmod. There is X on each folder and when I try to open it shows like this:

enter image description here

Now I can not use sudo to fix it because it gives this error:

sudo: error in /etc/sudo.conf, line 14 while loading plugin "sudoers_policy"
sudo: /usr/libexec/sudo/sudoers.so must be owned by uid 0.
sudo: fatal error, unable to load plugins

I also can not use chmod in /usr file since it needs sudo.

Is there a way to fix all permissions of the file?

2

There are 2 answers

0
Tsvetomir Baldjiiski On BEST ANSWER

Boot from Live Fedora USB

Locate /run/media/VOLUME_NAME of the Linux HDD

#su 
#mount -o remount,rw /run/media/VOLUME_NAME 
#chown root:root -R /run/media/VOLUME_NAME/usr 
#chmod 4755 /run/media/VOLUME_NAME/usr/bin/sudo 

Then reboot to the OS

#sudo rpm --setugids –a 
#sudo rpm --setperms -a
0
Hakan Alp On

I had to reinstall fedora from the start. But if there is any way to handle this, I would like to hear.