I used these commands to allow access to git clone katoolin to be stored in usr

sudo chmod -R 777 /usr/
sudo chown www-data:www-data /usr/

I don't know which one ruined my sudo access. Also, I don't have access to root. I tried entering into recovery mode then into root shell and used commands from /usr/bin/sudo must be owned by uid 0 and have the setuid bit set but it didn't work.

Kind of new to it. Some help would be helpful.

marked as duplicate by muru, karel, Eric Carvalho, Fabby, Zanna Nov 30 '18 at 16:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


sudo chmod -R 777 /usr;sudo chown www-data:www-data /usr/ broke your system irretrievably. There are two methods of recovering from such an error. First, and by far the easiest, is to reinstall Ubuntu. The second is to find the correct ownerships and permissions of each of the approximately 542,574 files and directories in /usr, and change each file or directory to the correct value for each one.

Not the answer you're looking for? Browse other questions tagged or ask your own question.