Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 41994  / 3 Years ago, fri, june 4, 2021, 5:50:28

So, I did a stupid thing...



I was installing some software (Java SE 7, if you must know) from a tarball, and I got tired of using sudo, so I went and changed the owner of my /usr directory to myself.



$ sudo chown -R sammy /usr


Whoops!



Since sudo lives in /usr/bin/, it also changed owner. Now, I can't use it anymore. Have I accidentally been caught in a sudo-Catch 22? I can't use apt-get install or any number of other essential features of my shell environment.



$ sudo
sudo: must be setuid root


Is there a way to change the owner of this directory (and subdirectories, too) back to root?


More From » permissions

 Answers
7

Restart the machine, boot into recovery (you should end up being root without having to type in any password). Proceed to chown -R. I think it should work. Report back on how it goes.


[#29362] Saturday, June 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ardingiba

Total Points: 497
Total Questions: 95
Total Answers: 109

Location: Gabon
Member since Sat, Jan 15, 2022
2 Years ago
;