• 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: do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script


  • Subject: Re: do shell script
  • From: Andrew Oliver <email@hidden>
  • Date: Fri, 13 Feb 2004 08:57:08 -0800

What you should do is use the command 'visudo' in a terminal window and add
the following line at the end:

mslomski ALL = /usr/sbin/bless

This allows the user mslomski to run the command /usr/sbin/bless via sudo.
mslomski can then 'do shell script "/usr/sbin/bless..." with administrator
privileges and will be prompted for their password before executing.

If you want to eschew the password requirement, make the sudoers line say:

mslomski ALL = NOPASSWD:/usr/sbin/bless

And they can run the command without specifying a password.

Andrew
:)

On 2/13/04 6:18 AM, "Michael Slomski" <email@hidden> wrote:

> Hello together,
>
> since I don't got an solution, here a new try:
>
> I have 2 accounts on my computer:
> mslomski without admin privs,
> Titan with admin privs
>
> User mslomski will get an error (not in sudoers file)
> User Titan can run the script witout problems.
>
> tell application "Finder"
> activate
>
> do shell script "/usr/sbin/bless -folder9 '/Volumes/System
> OS9/Systemordner' -setOF" password "passwOfTitan" with administrator
> privileges
> restart
> end tell
>
> What should I change, that user mslomski can run it also successfully?
> I have tried the following from the terminal:
> Disneyland:~ mslomski$ su Titan
> Password:
> Disneyland:/volumes/datenplatte/users/mslomski titan$ sudo /usr/sbin/bless
> -folder9 '/Volumes/System OS9/Systemordner' -setOF
> Disneyland:/volumes/datenplatte/users/mslomski titan$ exit
> exit
> Disneyland:~ mslomski$
>
> After that, systempreferences show the new blessed folder.
>
> It9s no problem for me to put the passwords in the script (passwOfTitan)
> only a placeholder.
>
>
>
> Best regards
> Michael Slomski
>
> --- Computerkartographie M. Slomski Kartographie Systemberatung &
> Betreuung f|r Apple Macintosh
>
>
> Schnorr-von-Carolsfeld-Str. 19 D-81927 M|nchen
>
> Tel.: ++49 +89-929 40 57 oder ++49 +177-44 57 990 Fax.: ++49 +89-939 311 71
> Email: email@hidden
>
>
>
>
>
>> Von: Michael Terry <email@hidden> Datum: Tue, 10 Feb 2004 13:46:29 -0800
>> An: AppleScript Users <email@hidden> Betreff: Re: do
>> shell script
>>
>> On Feb 10, 2004, at 1:03 PM, Michael Slomski wrote:
>>
>>> The following script will run fine if the user which is executing it has
>>> admin privs. What can i do if a user without admin privs can run this
> script?
>>> Is there a possibility to run it with something
>>>
>>> Run script as user xxx
>>>
>>> tell application "Finder" activate do shell script "/usr/sbin/bless
> -folder9
>>> '/Volumes/System OS9/Systemordner' -setOF" password "myAdminPassw" with
>>> administrator privileges restart end tell
>>>
>>
>> Doesn't it work, anyway?
>>
>> Or are you saying that you don't want to include the password in the script
>> where unprivileged users can see it? In that case, I think you can store
> the
>> password in a keychain file that the underprivileged user can't access and
>> have the script access it at need.
>>
>>
>> Mike _______________________________________________ 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.
> _______________________________________________
> 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.
_______________________________________________
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: do shell script
      • From: Michael Slomski <email@hidden>
References: 
 >Re: do shell script (From: Michael Slomski <email@hidden>)

  • Prev by Date: Select focus for GUI script
  • Next by Date: Looking for Specific Bytes in a File
  • Previous by thread: Re: do shell script
  • Next by thread: Re: do shell script
  • Index(es):
    • Date
    • Thread