Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

manick20

macrumors newbie
Original poster
Oct 26, 2015
2
0
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
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
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.

Code:
# 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.
 
  • Like
Reactions: Weaselboy
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.