BLACK FRIDAY EXTRA SAVINGS EVENT - EXTENDED
START FREE

Unable to set user permissions to no permissions

I’ve noticed that I can’t get rid of the rw in the user scope permissions. Could this be an issue with the fact that I’m running MacOS or could it be something else?

$ ls -l
total 40
drwxrwxrwx@ 2 user_name  group_name        64 Jul 29 19:07 Trash
-rwxrwxrwx@  1 user_name  group_name          0 Jul 29 19:07 config_file_1
-rwxrwxrwx@  1 user_name  group_name          0 Jul 29 19:07 config_file_2
-rwxrwxrwx@  1 user_name  group_name          0 Jul 29 19:07 disposable_file_1
-rwxrwxrwx@  1 user_name  group_name          0 Jul 29 19:07 disposable_file_2
-rwxrwxrwx@  1 user_name  group_name          0 Jul 29 12:38 practice_file_a
-rwxrwxrwx@  1 user_name  group_name  17792 Jul 29 19:09 wsend
$
$ chmod 111 practice_file_a
$ ls -l
total 40
drwxrwxrwx@ 2 user_name  group_name       64 Jul 29 19:07 Trash
-rwxrwxrwx@  1 user_name  group_name         0 Jul 29 19:07 config_file_1
-rwxrwxrwx@  1 user_name  group_name         0 Jul 29 19:07 config_file_2
-rwxrwxrwx@  1 user_name  group_name         0 Jul 29 19:07 disposable_file_1
-rwxrwxrwx@  1 user_name  group_name         0 Jul 29 19:07 disposable_file_2
-rwx--x--x@     1 user_name  group_name         0 Jul 29 12:38 practice_file_a
-rwxrwxrwx@  1 user_name  group_name 17792 Jul 29 19:09 wsend
$

Hi @quinones: you do not have enough privileges thus you need to elevate into sudo mode

r (read) -- 4
w (write) -- 2
x (execute) --1

Cumulative permissions (1 or more) should be the sum of these numbers. Usually in MacOSX, when a file is created, minimally read permissions are granted to all user types (owner, group and others). Thus if you really want to change the permission, which I highly do not recommend, you can use:

$ sudo chmod 111 practice_file_a

Note you will be asked for your password and that you wont be able to do anything to this file/folder and there is usually no reason why you would want to do this as even the owner of the file folder cannot read or write to it, thus rendering it meaningless.

To undo this, simply enter:

$ sudo chmod 744 practice_file_a

Hope this helps!

image

1 Like