How do I give users capabilities in OSX? I googled it and I found no answers. The setcap command doesn't exist in OSX.

  • What makes you think that OSX has a CAP_CHOWN capability? Anyway, if you want users to be allowed to run chown, make them sudoers. Letting people run chown lets them run command as root if they want. – Gilles Mar 23 '16 at 23:46
  • 2
    I don't mean the CAP_CHOWN capability directly, I mean capabilities in general. – John Militer Mar 23 '16 at 23:53
  • AFAIK OSX doesn't have any feature that's called “capabilities” and that's similar to Linux's capabilities. What are you trying to accomplish? – Gilles Mar 23 '16 at 23:56

The original question asked how to grant users the capability to change file ownership. This is probably not a good idea, but you could grant a given user (or group) the ability to sudo and "limit" that to the chown command.

You might want to limit it further by installing (into an area where they could not modify it) a script which does the chown after checking that the pathnames it affects are not in the system area (though the recent security fixes for OSX would ward off most of the potential damage).

More generally, sudo is where to look. It can allow users (or groups, which means any user who's a member of a group) to execute specific commands — or any command.

Further reading:

  • I solved that sort of problem for some users by creating an account for shutdown (a while before shutdown accounts were common). A reboot account would be similar: privileged but only able to do one thing. – Thomas Dickey Apr 4 '16 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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