Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > permission for a script

permission for a script
Thread Tools
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 14, 2001, 09:09 PM
 
I have a script that I want some regular users to run. It goes as follows:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
#/bin/sh
/usr/shared/nvram boot-device=hd:,\\:tbxi
</font>[/code]

Obviously to change the startup disk.

It won't work due to permission problems (duh) so...

I think I need to use the sudoers file or something to give all users the ability to use that command, but that command only. Can anyone explain how to go about doing that.
I always use protection when fscking my Mac... Do you?
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Jul 15, 2001, 02:38 AM
 
You need to add a line to the sudoers file to identify the user as being able to run a root-level command.

Use visudo as root to add something like:

<font face = "courier"> username ALL = NOPASSWD: /usr/shared/nvram </font>

This identifies user username as being able to run /usr/shared/nvram as root. The NOPASSWD tag indicates that the user doesn't need to specify a password to sudo. Omitting the NOPASSWD would prompt the user for their password, just like a normal sudo command would.

For more details on sudoers, check the man page or Sudoers Man Page
Gods don't kill people - people with Gods kill people.
     
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 15, 2001, 06:56 AM
 
Thanks
I always use protection when fscking my Mac... Do you?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 22, 2001, 03:52 AM
 
Or you could suid root the script.

sudo chown root blah.sh
sudo chmod 4755 blah.sh
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2