|Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?|
This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at http://bsdwiki.reedmedia.net/wiki/View_file_permissions_and_modify_them_using_either_symbolic_or_octal_mode.html.
View file permissions and modify them using either symbolic or octal mode
Author: Ivan Voras IvanVoras FreeBSD
An administrator is expected to have a thorough understanding of
traditional Unix permissions including: how to view and modify permissions (i.e. "mode bits"),
why the sticky bit is important on
File ownerships and mode bits are the single most important file system security feature in unix systems. Each file and directory has three attributes attached:
User and group IDs are simple numeric identifiers taken from
Since the permissions form a bitmask, each has it's numerical value. To make using numerical values of mode bits easier, they are usually written in octal notation (hexadecimal is not used because the number of mode bits is low enough):
Each of the above numbers is prefixed with 0 because that's how they are distinguished from decimal and hexadecimal numbers. To make a complex permissions these numbers are added together. For example, to form a
To specify a compound permission which describes all mode bits for user, group and others, three digits are used (four with the 0 prefix). The first digit describes permission of the uid user, the second of the users in gid group and the third those of all other users. A common permission is 0644, which allows the owner to read and write the file, and enables all other users to just read the file.
The command to set mode bits is chmod.
TODO: mention discretionary control
ls(1), chmod(1), umask(1) or umask(2)