1

Through a series of unfortunate events I managed to run:

sudo chown -R `whoami`:admin /usr

on my 10.10.5 machine. This has left it in an awkward state. I can no longer sudo commands as sudo is no longer owned by root on the machine.

I tried booting in to single user mode and chown'ing /usr back to root:wheel but /usr is a read-only file system in single user mode.

Apart from a total reinstall of OS X on the machine, is there anything else I can do to get the permissions on /usr back to root:wheel?

  • Did you try running mount -u -w / after booting to single user mode? Should remount the drive in read/write mode. – nohillside Sep 24 '15 at 19:55
  • 1
    And, if you chown'ed everything, can't you just run chown root /usr/bin/sudo? It's your file and directory after all currently :-) – nohillside Sep 24 '15 at 19:57
  • @patrix figured out the first bit just before you commented. :) Uh...I never thought to try the second suggestion. Myopic panic-induced tunnel vision as I screwed up my work laptop. :) – Ian C. Sep 24 '15 at 19:59
  • Not sure whether it will work though, maybe the set-user-ID flag gets killed which is required for sudo to work. – nohillside Sep 24 '15 at 20:00
  • 1
    @bmike I have other feelings about SIP. See site chat! :D – Ian C. Sep 24 '15 at 23:13
3

Managed to make / writeable by running

mount -uw /

in single-user mode and then I was able to repair the permissions with:

chown -R root:wheel /usr
  • So cool the system is sane enough to boot in single user mode and work. Recovery HD has terminal as well, but single user is faster when it works. – bmike Sep 24 '15 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .