How to overwrite the asking for authentication when running an admin shell script in Apple Script?

前端 未结 3 539
夕颜
夕颜 2020-12-17 05:01

I\'m wanting to make a simple program that runs each time on login behind the UI. In my applescript I\'m running a sudo command that requires admin authentication. Is there

3条回答
  •  甜味超标
    2020-12-17 05:32

    Another solution is editing the

    etc/sudoers
    

    configuration file.

    A setting on that file can allow a specific user to execute a specific commands (with... yes... specific parameters) as super user.

    If the command itself is not the problem, but the problem is exposing the password in the code then this may be the solution.

    The sudores file should be edited running the command visudo as super user.

    Before you start tampering with sudoers I strongly suggest you to get a basic knowledge of visudo and the sudoers syntax, as messing that file may causes serius issues to the system.

    As you know what you are doing is just a matter of adding a couple of lines.

    For information you may Google or start here http://www.sudo.ws/sudoers.man.html

提交回复
热议问题