How to solve SUDO command related problem due to File permission
Accidentally I had ran a command
sudo chmod -R 777 /
on my Ubuntu/LINUX PC and
it was just starting of problems!
I can't run command with
sudo
, can't add/remove any admin or user. Because the
current root user has no permission to authenticate.
When I run any command starting with
sudo
, the following errors found:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
When I try to authenticate, it shows:
Incorrect permission on /usr/lib/policykit-1/polkit-agent-helper-1(need to
setuid root)
How I resolved this error:
- Restart your PC
- Go to Recovery Mode
- Run the following command:
chmod -R 755 /
- Reboot
-
Try again any command starting with sudo. Now you will find only error:
/usr/bin/sudo must be owned by uid 0 and have the setuid bit set
- To solve this again restart your PC
- Go to Recovery Mode
-
Run the following command:
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
- Reboot
Boom! It solved.