Next | Prev | Up | Top | Contents | Index

Configuring Default File Permissions With umask

A system default called umask controls the access permissions of any files or directories that you create. The system default for IRIX, without umask set, is 022, which sets the following permissions respectively:

user

Full access: read, write, and, if applicable, execute permission. Directories can be executed; that is, you can ''change directories'' into any of your own directories and copy files from them.

group

Anyone in the same group can read and, if applicable, execute other group members' files. Execute permission is turned on for directories. Write permission is turned off.

other

All other people on the system have the same access permissions as group access.
The system default umask of 022 is the same as running chmod 644 on files that you create and chmod 755 on directories and executable files that you create. Setting your umask does not affect existing files and directories. To change the default permission, use the umask shell command. Like chmod, umask uses a three-digit argument to set file permissions. However, the argument to umask works the opposite as the argument to chmod. The argument to umask lowers the access permissions from a maximum of 666 (full access for files) and 777 (full access for directories).

The following command leaves permission unchanged for user, group, and other when you create files and directories:

umask 000

This command reduces access for other users by 1 (it removes execute permission):

umask 001

This command reduces access for group by 1 (no execute permission) and for others by 2 (no write permission, but execute is allowed):

umask 012

This command removes write and execute permission for group and removes all permissions for others:

umask 037

For more information, see the umask(1) reference page.


Next | Prev | Up | Top | Contents | Index