Cannot Run Any Sudo Command
I Am Getting an Error When Trying to Run Any Command in Sudo Mode. Error: Sudo: /Usr/Bin/Sudo Must Be Owned by Uid 0 and Have the Setuid Bit Set I Found a...
I am getting an error when trying to run any command in sudo mode.
Error:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
I found a number of questions and accepted answers on askubuntu.
But none of those solved my problem. Probably my case is different from them.
More information :
I tried to install utorrent following the top voted answer of this question.
After extracting the .tz file to /opt I renamed the extracted file.
Since then I am facing this error.
I expect an answer which doesn't suggest me to reinstall the system.
If reinstalling is the only solution, I would have to backup everything I ever installed.
4 Answers
Must Read
Simple fix, if you did not also mess up pkexec:
The problem is that your /usr/bin/sudo has the wrong permissions set (-rwxrwxr-x instead of correct -rwsr-xr-x).
Now, as the file is owned by root, you need root permissions to change its permissions. Usually, you would use sudo for this, but as it's broken, we have to use pkexec as replacement to repair it:
pkexec chmod u+s,g-x /usr/bin/sudo
Now everything should be fixed again. Try the e.g. following command to check:
sudo echo "sudo works again! Yay! :D"