Tuesday 1 May 2018

macos - How to run a program as root without "sudo"?


I have a certain binary program on OS X that can only be run as root.


I'm tired of prepending sudo each time I invoke it and typing the password, and would like it to automatically run as root when I invoke it regularly, without asking for a password.


The program's owner is root and its group is wheel.


I tried chmod ug+s to set the userid and groupid upon execution to root/wheel, but when I run the program without sudo it still complains that it can only run with sudo or as root.



Answer



Are you sure that the program you are trying to execute is actually a binary, and not a shell script. Most shells ignore suid scripts because they are really, really hard to do safely. An easy way to check is to use the file command on the program.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...