Friday, August 17, 2007

Specify or Report Default Permissions with umask

The umask command can be used to specify default permissions on files you create. It also can be used to report on a file's current defaults. Here are some examples.

Explanation of what the octal digits mean
0 - don't restrict any permissions
1 - restrict execute permissions
2 - restrict write permissions
4 - restrict read permissions

Report current umask setting
# umask

Provides complete access to every file you create on the system to everyone.
# umask 000

Provides complete access to you and your group. The others (world) are excluded.
# umask 007

Provides complete access to you but limits group and others to read and execution.
# umask 022

No comments: