• 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: Terminal & "sudo" with "password" & "with administrative privileges"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminal & "sudo" with "password" & "with administrative privileges"


  • Subject: Re: Terminal & "sudo" with "password" & "with administrative privileges"
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 19 Jun 2006 18:17:05 -0700

On Jun 19, 2006, at 11:57 AM, Andrew Oliver wrote:

'do shell script' executes the script directly, so your 'tell application "Terminal" is irrelevant.

Additionally you should not use 'sudo' in do shell script since it will hang waiting for authentication. The 'with adminsitrator privileges' takes care of the authentication process.

Oh yeah, that too. That's discussed in the same technote, a couple of sentences later. Using "sudo" only hangs in 10.4.0 and 10.4.1, but it's still not necessary.



--Chris Nebel AppleScript Engineering

On Jun 19, 2006, at 11:48 AM, Bob Majors wrote:

I used to run a script as follows that worked in a previous (10.2 / 10.3?)
Mac OS, but is not working under the current 10.4. The machine in use now
is new; built from scratch.


tell application "Terminal"

   activate
   do shell script "sudo chown -R user01 /Users/user01" password
"thepassword" with administrator privileges

end tell

(Note: "thepassword" is the Administrator password.)

"AppleScript Error. Terminal got an error: A privilege violation occurred."

I also tried invoking sudo (and entering the password manually) from
Terminal, then running the script; same results.

Running this command manually works.

Doing an ls (prior to running the command) I see:

drwxr-xr-x 15 user01 staff 510 Oct 10 2005 user01

Ideas? Thanks.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Terminal & "sudo" with "password" & "with administrative privileges" (From: Bob Majors <email@hidden>)
 >Re: Terminal & "sudo" with "password" & "with administrative privileges" (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: Dot files
  • Next by Date: Re: Currency Numbers
  • Previous by thread: Re: Terminal & "sudo" with "password" & "with administrative privileges"
  • Next by thread: Re: Currency Numbers [2]
  • Index(es):
    • Date
    • Thread