Entradas

Mostrando las entradas etiquetadas como calculate umask

How to calculate permissions from umask

Umask (user mask) is a command that defines what default permissions will be established when a file is created by a determined process or user. First the basis: permissions are represented like this in Unix systems: rwx - rwx - rwx . Where r - Read w - Write x - Execute And where the first group of rwx belongs to the owner , the second to the group and the third to other users . Example: rwx - r-x - r-x In this case the permissions are: the owner has rights to read, write and execute . The group to read and execute . Other users to read and execute . So now lets see how to obtain the permissions from a umask: Example: if our umask is of 022, the default permissions for directories will be: 755 (drwx-r-x-r-x) and for files 644 (rw-r---r--). And how did we obtain this? Now lets see how. Before making any calculation: The initial permissions for directories are 777. The initial permissions for files are 666. In the next steps will see how this values are applied to obtain the default pe...