0

I am trying to learn UNIX permissions for the purposes of safeguarding raw data. My OS is macOS Catalina.

While trying to learn to use chmod, I've come across a situation where chmod will not make the changes I'm telling it to. Here is an ls -lO@ of the folder I'm trying to change:

[~/Desktop/test--file-permissions]
> ls -lO@
total 0
drwxr-xr-x@ 4 leo  staff  - 128 Jul  4 16:11 test--work
    com.apple.favorite-rank.number#PS    14
    com.apple.macl   72
    com.apple.metadata:_kMDItemUserTags  42

I want to make this folder and all its contents read only:

chmod -R 444 test--work

If I do ls -lO@ again, it shows that only permissions for the 'group' and 'other' have been set to read only but the 'user' permissions have remained the same:

[~/Desktop/test--file-permissions]
> ls -lO@
total 0
drwxr--r--@ 4 leo  staff  - 128 Jul  4 16:11 test--work
    com.apple.favorite-rank.number#PS    14
    com.apple.macl   72
    com.apple.metadata:_kMDItemUserTags  42

Why does chmod not change the user permissions? (I am using zsh, not bash, if that somehow affects anything)

Edit: The reason I'm trying to remove all write permissions, even for the user, is that my goal is to lock and protect raw scientific data on an external hard drive so that whoever plugs it into their computer to use (i.e. irrespective of 'user'), the files cannot be accidentally deleted or moved.

Edit 2: I found this on another post which suggests the access control list (ACL) might have something to do with it, but I don't know how that works: https://superuser.com/a/671456/945371

Edit 3: clarified by adding output of ls -lO@ instead of just ls -l

Leo
  • 1

0 Answers0