Hello, good people SO,
I am writing a shell script that will change some system settings, such as HostName (scutil --set HostName), which require permission processing. The script will be run inside the application generated by Platypus .
As soon as my script calls scutil (for example), I, of course, force the security server to request authentication from me.
Looking at the security man page, I am interested in two flags:
security authorize security execute-with-privileges
Also from the man page I will give an example:
security -q authorize -uew my-right | security -q authorize -i my-right
"Allow the right and transfer it to another team as a way to add authorization to shell scripts."
Be that as it may, I am not getting what I want from this, and I suppose I just don’t understand how to use it correctly. Does anyone have more info? What I find in the search does not make me wiser. I would appreciate help in:
- Getting a credential request script once to run the entire script elevated.
- Request credentials once so that they can be sent to individual commands within the script that need a boost.
Running a script with the Platypus flag Running as an administrator still ends with running a script with $ EUID not 0 (zero).
I suppose means that the script is somehow elevated, but does not work as root. This height, if it works, seems insufficient to call scutil --set HostName x , because this command is still requesting credentials.
If you need further clarification, just pat!
Thanks in advance.
Regards, Ted
source share