Re: How to Run a "sudo" Terminal Command
Re: How to Run a "sudo" Terminal Command
- Subject: Re: How to Run a "sudo" Terminal Command
- From: Jim Weisbin <email@hidden>
- Date: Thu, 17 Dec 2015 11:11:31 -0500
I'd like to know how to do it _without_ the dialog. Something like:
do shell script xxx with user ID yyy and password zzz
There is a way, but whether or not it is an acceptable security risk to you is a question I can’t answer.
You can find info here:
Basically you can edit /etc/sudoers so your admin user is a sudoer with all privileges. Then your shell script can use “sudo” without getting a prompt back.
This of course means that the script is not portable, but neither would it be if you were to hard encode a username and password into it.
Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com Click here to view our online reel
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden