Entradas

Mostrando las entradas etiquetadas como 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...

Como calcular permisos de umask

Hola, hoy voy a escribir sobre como se calculan los permisos resultantes de umask (máscara de usuario). El umask es una orden que establece que permisos por defecto se van a establecer al crear un archivo por determinado proceso o usuario. Primero lo básico: los permisos se ven de esta forma en los sistemas Unix: rwx - rwx - rwx . Donde r - Lectura w - Escritura x - Ejecución Y donde el primer grupo de rwx corresponde al dueño , el segundo al grupo y el tercero a otros usuarios . Por ejemplo: rwx - r-x - r-x   En este caso los permisos serían: el dueño tiene derecho a lectura, escritura y ejecución . El grupo a lectura y ejecución . Otros usuarios a lectura y ejecución . Entonces para calcular los permisos resultantes según la umask sería así: Por ejemplo si nuestra umask es 022, el permiso por defecto para directorios sería: 755 (drwx-r-x-r-x) y para archivos 644 (rw-r---r--). Antes de hacer los cálculos: Los permisos iniciales para directorios son 777 Los p...