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 > macOS > sudo, sudoers, file attributes problem in 10.5

sudo, sudoers, file attributes problem in 10.5
Thread Tools
rehoot
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
May 18, 2008, 08:26 PM
 
I got a new computer with 10.5, and I'm having a problem with sudo. My normal login account is "standard," and I created an "admin" account that I normally do not use. From the "standard" account, I can't seem to get the sudo command to allow me to edit my shell scripts that I have in /usr/bin.

on my 10.3 computer (and I think my 10.4 computer), I can set the permissions on a file like this:
-r-xr-xr-x 1 root wheel 40 Jan 23 2006 XX1.sh
or like this
-r-xr-xr-x 1 rehoot staff 658 Aug 6 2004 XX2.sh
and then edit it using sudo emacs XX1.sh.

on my 10.5 computer, it seems like I have to set the "w" flag for the user even if the permissions are set for my "standard" user ID--sudo does not let me edit a file like this:
-r-xr-xr-x 1 rehoot staff 658 Aug 6 2004 XX2.sh

Is this a feature, or am I doing something wrong? The sudo command works as suggested by this:
[rehoot:/usr/bin] # sudo id
Password:
uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),102(com.apple.sharepoint .group.2),8(procview),2(kmem),29(certusers),3(sys) ,9(procmod),4(tty),101(com.apple.sharepoint.group. 1),5(operator),80(admin),20(staff)
[rehoot:/usr/bin] #


I used Directory Utility to enable root user and give it a password, and I put my user id in sudoers using visudo.
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 18, 2008, 08:50 PM
 
When you added yourself to sudoers, did you give yourself permission to access emacs?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
rehoot  (op)
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
May 18, 2008, 09:01 PM
 
Originally Posted by Chuckit View Post
When you added yourself to sudoers, did you give yourself permission to access emacs?
Here are a few lines from sudoers. I do not have this line in my 10.3 computer, but my sudo comands work on that computer:

# User privilege specification
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
rehoot ALL=(ALL) ALL

and I still can't edit the shell files in /usr/bin. My user ID is rehoot. I had gotten an error message what I was fixing permissions. It said there was an unexpected ACL on Applications and another folder or two. I ran fsaclctl to disable ACL (I did not enable ACL), and I still can't edit the files without changing the permissions.
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
rehoot  (op)
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
May 18, 2008, 09:16 PM
 
For now I don't want to fight the computer, so I modified the permissions for *.sh in /usr/bin to look like this:

-rwxr-xr-x 1 root wheel

with the "w" for the user. I did this with

sudo chmod u+w *.sh
sudo chown root:wheel *.sh

It didn't seem to make any difference if I set the group to "wheel" or "admin," but I used "wheel". If I find a fix or an explanation, I'll post it here. I guess technically, 10.5 is doing what I tell it to do, so maybe it is a fix for "permissive behavior" in the versions of OS X.
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 03:45 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,