How to set file permissions for root in OS X / Terminal?

I am having problems with Apache working with my virtual hosts and I narrowed it down to the point of adding manually created virtual hosts (compared to others created using the python script). When I run:

  ls -l 

I get this:

  -rw-r - r-- 1 root wheel 772 May 10 17:53 host1.com
 -rw-r - r-- 1 root wheel 766 May 10 17:53 host2.com
 -rw-r--r--@ 1 myname wheel 914 Mar 28 14:24 host3.com
 -rw-r - r-- 1 root wheel 3897 May 10 17:53 host4.com
 -rw-r - r-- 1 root wheel 5240 May 10 17:53 host5.com
 -rw-r - r-- 1 root wheel 4037 May 10 17:53 host6.com

I'm not sure what β€œ@” means, but this manually created file has a username instead of the root owner. When I look at the file information in OS X (Finder), I see that permissions for most files show that the "system" has read and write access, but my manually created vh file shows what I have (my username) There is read and write access.

Can someone tell me how to set permissions for the "system" or "root" in the terminal? I have superuser access.

+4
source share
2 answers

@ indicates that extended attributes exist. You can use the xattr command to look at them
You can set the owner using chown

0
source

You can change the ownership of the file in the terminal using

sudo chown owner:group filepath 

Or in your case

 sudo chown root:wheel filepath 

Alternatively, you can change file permissions using chmod

+8
source

Source: https://habr.com/ru/post/1480189/


All Articles