4

I am unable to add group write to a file on Mac OSX server using root. I'm guessing root on OSX is not really root then.

Does anyone know how I can proceed? Any operation on this file that requires privileged user fails.

server:WEBSITE root# whoami 
root
server:WEBSITE root# chmod g+w PORe\ logo.jpg 
chmod: Unable to change file mode on PORe logo.jpg: Operation not permitted
Rob
  • 247
  • 1
  • 3
  • 13

1 Answers1

9

Root is root, even on OS X Unix. That is why they disable it by default.

A quick google has shown that your file could be potentially locked. If you go and issue the command:

 chflags nouchg /path/to/item

and then try your file again:

chmod g+w "PORe\logo.jpg"

This should allow you then to change things on that file specifically.

Make sure that your chmod switches are doing what you want them to do also. I experienced an issue whereby executing stuff on root would not do anything, but prepending my command with "sudo" did the trick, I then realised I had an issue with my root group in /etc/group.

If your root is like this: "root:x:0:" then it's ultimate root. (Note: Group 0 = root)

Below are a couple links that can provide you more information about chflags and the original source of this answer:

  1. http://ss64.com/osx/chflags.html
  2. https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/chflags.1.html

Original answer from post:

  1. http://forums.macrumors.com/showthread.php?t=1063440
Proxy
  • 574
  • 1
  • 4
  • 14
  • Thanks for your very thorough answer, I'm working through it now. – Rob Feb 06 '15 at 12:15
  • I added more information for you about root. I would hardly call this a thorough answer though!! :) – Proxy Feb 06 '15 at 12:16
  • Brilliant, it was indeed locked, `ls -lOa` showed `uchg`. It's possible this issue might be related to the ACL on this volume, weird that just this file was locked. Might have been a legacy issue before I created the ACL. Good explanation and references. Thank you very much! – Rob Feb 06 '15 at 12:24