Today, by mistakenly, I set the 'sudo chmod -R 777' to my /usr/bin folder as a root user. After doing that, I found that , my sudo command was not working at all. After spending a couple (of) hours over google, finally I got the solution and here I am going to share with you.
In an attempt to set permissions for my local scripts(because as I told you ,I broke the sudo permission and changed ownership, by mistake ), and back the ownership of sudo to root , I followed the following steps:
Step 1: Switch to ubuntu recovery mode. If you are unaware of the process, you can refer an answer here: https://brajeshnotes.blogspot.com/2018/10/how-can-i-start-ubuntu-in-safe-mode.html
Step 2: Once in recovery mode, select root - Drop to root shell prompt
mount -o remount,rw / chown root:root /usr/bin/sudo chmod 4755 /usr/bin/sudo reboot
Note*: If after reboot , sudo comes up with the same three errors mention below :
sudo: /usr/lib/sudo/sudoers.so must only be writable by owner
sudo: fatal error, unable to load plugins.
Try this :
$ mount -o remount,rw / $ chmod 644 /usr/lib/sudo/sudoers.so rebootWait for your system to boot normally and you will see the ownership of sudo back to root.After doing these all steps, still you guys facing any problem, please leave your valuable comments here, I will try to answer my best.
You Are Good man, Thank You Alot <3
ReplyDeleteWelcome dear :)
DeleteAfter follow your instruction i have not able to start my system. It's show always booting process,Can you please suggest me, It's very urgent.
ReplyDeleteApologies for the delay response. What problem are you facing?
DeleteThis comment has been removed by the author.
ReplyDelete