apple script to give admin rights

Discussion in 'OS X Yosemite (10.10)' started by manick20, Oct 26, 2015.

  1. manick20 macrumors newbie

    Oct 26, 2015
    i am having around 200 macbook and i have run a command default write and change some settings in .plist,
    so each and every time i have to type the admin password, is it possible to write the script that give the admin rights to the command only
  2. MacUser2525 macrumors 68000


    Mar 17, 2007
    You can look into the sudoers file it allows you the ability to in effect whitelist a command so it does not need the password to a command that normally would. A snippet from my file as an example I added for exactly this type of idea.

    # Added to allow ZFS commands without password
    MacUser2525 ALL=(ALL) NOPASSWD: /usr/sbin/zpool, /usr/sbin/zfs
    You need to use the command visudo to edit the file so it remains locked when editing. I am thinking a simple bash script in the /usr/local/bin directory containing the commands you use will do the trick.
  3. manick20 thread starter macrumors newbie

    Oct 26, 2015
    thank you for the reply.. i will try the solutions

Share This Page