0

I accidentally ran sudo chown -R root:root /usr/ on my ubuntu machine (while playing around with sd-card of my Raspberry Pi. I actually wanted to type sudo chown -R root:root usr/ without slash.)

Now I get this error: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set.

Is it possible to fix this?

EDIT: I had the wrong command in my post before. I forgot the root:root. Although all files in /usr are owned by root I get the error message.

jake
  • 111
  • What are you running on the pi? (ie. OS & release) – guiverc Jan 09 '19 at 06:49
  • @guiverc There is some misunderstanding. My question is not about a Raspberry Pi. Sorry, if I did not put that right! – jake Jan 09 '19 at 10:28
  • The command sudo chown -R root:root /usr/ is not the source of your problem, /usr/bin/sudo is owned by root anyway and permissions are not changed with this command. – mook765 Jan 09 '19 at 11:48
  • @mook765 Well, I know, but after running this command the setuid bit was not set anymore and don't now why. And some stuff in /usr/ has different groups then root. I set the setuid bit for sudo in recovery mode and reinstalled everything and fixed some permissions (at chage ssh-agent) manually. – jake Jan 09 '19 at 11:57
  • @jake Found something interesting here: https://unix.stackexchange.com/questions/53665/chown-removes-setuid-bit-bug-or-feature – mook765 Jan 09 '19 at 12:21

0 Answers0