• 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 with admin privileges without admin login
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running script with admin privileges without admin login


  • Subject: Re: Running script with admin privileges without admin login
  • From: "Dr. Max Bonilla" <email@hidden>
  • Date: Thu, 05 Feb 2004 16:39:39 -0500

Thank you, Andrew.

Max
Max Bonilla, SSL, STD
Associate Dean for Program Development
Franciscan University of Steubenville
1235 University Blvd.
Steubenville, OH 43952-1763
Ph (740) 283-6228
Fax (740) 283-6401



On 2/5/04 3:24 PM, "Andrew Oliver" <email@hidden> wrote:

> Or, just edit /etc/sudoers so that all users can run the 'mDNSResponder
> stop' command.
>
> sudoers allows some fine-grain control over who can do what, and when. IMHO
> this is preferable to embedding the admin password in the script.
>
> Andrew
> :)
>
> On 2/5/04 10:52 AM, "Graff" <email@hidden> wrote:
>
>> Well you can only use sudo for a command if you are given that
>> permission in the file "/etc/sudoers". Sudo doesn't really turn you
>> into the root user, what it does is allow you to use the command with
>> more than your normal privileges and your use of sudo is logged. This
>> is why you enter in your password, not the root password.
>>
>> If you are logged into an account that and want to use a command that
>> the acount doesn't have privileges for and isn't in the sudoers file
>> then you need to use the command "su" to switch to a user that has
>> permission to use the command. For example, you could do this in the
>> Terminal (you will need to enter a password after the first line):
>> ---------
>> su admin_user_name
>> /System/Library/StartupItems/mDNSResponder/mDNSResponder stop
>> exit
>> ---------
>>
>> !!!!!!!!!!!!!!!!!!!! BE VERY CAREFUL with the shell command "su".
>> !!!!!!!!!!!!!!!!!!!!
>>
>> It is possible to screw things up severely, especially since some of
>> the protections built into "sudo" are not part of "su".
>>
>> However, I think that you might not need sudo at all, however. Give
>> this a try:
>> ---------
>> do shell script
>> "/System/Library/StartupItems/mDNSResponder/mDNSResponder stop"
>> password "password" with administrator privileges
>> ---------
>>
>> If that doesn't work then try this:
>> ---------
>> do shell script "su admin_user_name;
>> /System/Library/StartupItems/mDNSResponder/mDNSResponder stop; exit"
>> password "password" with administrator privileges
>> ---------
>>
>> To learn more about "sudo" and "su do "man sudo" and "man su" in the
>> Terminal. I'd recommend that you read those man pages carefully to
>> understand how it all works "under the hood"
>>
>> - Ken
>>
>>
>> On Feb 5, 2004, at 11:50 AM, Dr. Max Bonilla wrote:
>>
>>> Hello everyone,
>>>
>>> Here's a problem one of my colleagues has. Perhaps someone can help
>>> us. He
>>> sent me this explanation:
>>>
>>> This script works fine if you execute it as an administrator user, but
>>> not
>>> as a normal user. I'm trying to figure out a way to execute this in the
>>> Student user account, which is not an administrator account. The other
>>> problem is that I am planning on having this script be a hidden login
>>> item,
>>> so any solution that would require the administrator password to be
>>> typed in
>>> is not an option.
>>>
>>> on run
>>> do shell script ,
>>> "sudo /System/Library/StartupItems/mDNSResponder/mDNSResponder
>>> stop"
>>> password "password" with administrator privileges
>>> end run
>>>
>>> Any ideas? Thanks a million.
>>>
>>> Max
>>> _______________________________________________
>>> 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.
_______________________________________________
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.

References: 
 >Re: Running script with admin privileges without admin login (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Help with NSPopUpButtonCell and data sources needed
  • Next by Date: Calculate Sunrise, Sunset?
  • Previous by thread: Re: Running script with admin privileges without admin login
  • Next by thread: Re: Running script with admin privileges without admin login
  • Index(es):
    • Date
    • Thread