I have a bash script. I want to transfer ownership of that file to root such that a sudo password is required to execute the script. How would I accomplish this on Mac? Thanks!

  • The same as in any other UNIX! – 174140 Sep 5 '19 at 0:29

I asked to early! The following worked:

sudo chown root:admin script.sh

sudo chmod 700 script.sh

| improve this answer | |

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.