Here is another interesting thing I came through very recently. If you have ever used a unix based operating system like Ubuntu, I bet you have had run into problems which happens suddenly, and you have no idea what caused it :)
This is the error I got,
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
Now I’m going to tell you how I got the above error and how I fixed it.
I searched in many forums about this, and I found that there are two reasons for getting this error.
01. Directory “/usr/bin/sudo“ is not having permission 755.This happens if you run a command like “sudo chmod –R 777/usr/” - which will set the permission to 777 for all the directories recursively.
02. Directory “/usr/bin/sudo“ is not owned by the root user. (In case if you have run a command to change the owner.)
My issue was due to reason 01, and I solved it by following the below steps.
First restart your pc, and press the SHIFT key while Ubuntu is booting.
This will bring you up the boot menu.
Select Advanced Options.
Select your OS version in (recovery mode), and press Enter Key.
Ex : Ubuntu 14.04 (recovery mode)
It will bring you up another screen. Now select “Drop to root shell prompt” and press Enter.
It will load a command line at the bottom of the screen.
Now run each of the following commands.
mount -o remount,rw /
mount --all
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
restart
Now your pc will restart. Once you log in, you will find that you can use the sudo command again :)
Please leave a comment if this worked for you.
网友评论