jerome Asked: 2011-09-29 18:22:31 +0800 CST2011-09-29 18:22:31 +0800 CST 2011-09-29 18:22:31 +0800 CST sudo: must be setuid root (Mac OS X) 772 I ran $ sudo chown -R $USER /usr/bin and now when I try to run programs under the /usr/bin path as sudo I get sudo:must be setuid root What should I do if I would like to revert the chown? mac-osx sudo setuid 4 Answers Voted Best Answer Gordon Davisson 2011-09-29T23:53:26+08:002011-09-29T23:53:26+08:00 Run Disk Utility, select your boot volume, and use "Repair Permissions". Since the files in /usr/bin (including sudo) were installed as part of the OS, it knows what their ownership and permissions should be, and it'll set them back properly. Ozz Nixon 2015-10-21T13:14:35+08:002015-10-21T13:14:35+08:00 xattr /usr/bin com.apple.FinderInfo com.apple.rootless xattr -d <extended_attribute> /usr/bin that will remove the attribute, so you can do the commands, then make sure you re-enable the attribute when you are finished: xattr -w <extended_attribute> /usr/bin that will re-enable the attribute. Ozz David Schwartz 2011-09-29T18:24:34+08:002011-09-29T18:24:34+08:00 You need to chown the files back to root and then chmod u+x all the programs that should be setuid root. quanta 2011-09-29T18:25:45+08:002011-09-29T18:25:45+08:00 I'm not familiar with OSX but in Linux, you can do it by running su - to login as root and chown -R root /usr/bin.
Run Disk Utility, select your boot volume, and use "Repair Permissions". Since the files in /usr/bin (including sudo) were installed as part of the OS, it knows what their ownership and permissions should be, and it'll set them back properly.
that will remove the attribute, so you can do the commands, then make sure you re-enable the attribute when you are finished:
that will re-enable the attribute.
Ozz
You need to
chown
the files back toroot
and thenchmod u+x
all the programs that should be setuid root.I'm not familiar with OSX but in Linux, you can do it by running
su -
to login as root andchown -R root /usr/bin
.