Can umask be used for special permissions

356 Views Asked by At

Is there a way to set special permissions on files and directories during its creation using umask or some other command ?

i.e if I set umask to 0000 , the file permissions will become 0666 and for directories it will be 0777 . In any case , default special permissions are not set .

1

There are 1 best solutions below

0
On

No, it is not possible to set special permissions with umask.

Quoting the Arch Wiki: umask:

The suid, sgid and sticky bits of the mask are ignored.

Use chmod to set gid and uid bits.