• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Running Script as root using Sudo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running Script as root using Sudo


  • Subject: Re: Running Script as root using Sudo
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 27 Feb 2002 11:46:02 -0800

On Wednesday, February 27, 2002, at 10:02 AM, garbanzito wrote:

at 2002 02 27, 08:31 -0600, they whom i call Chris Prew wrote:
Has anyone been able to get sudo to run from a script using stdin for the
password

discussed many times in the archives...

do shell script "echo password | sudo -S command"

or

do shell script "sudo -S command <password.txt"

or better yet,

do shell script "command" with administrator privileges [password "password"]

If you leave off the password parameter, it'll prompt you for it. This makes it possible to create a script that will run on other people's machines and isn't wildly insecure.


--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Running Script as root using Sudo
      • From: garbanzito <email@hidden>
References: 
 >Re: Running Script as root using Sudo (From: garbanzito <email@hidden>)

  • Prev by Date: Re: Scripting audio feedback?
  • Next by Date: Re: Read file using delimiter in 1.6
  • Previous by thread: Re: Running Script as root using Sudo
  • Next by thread: Re: Running Script as root using Sudo
  • Index(es):
    • Date
    • Thread