Unix security: Difference between revisions

Content deleted Content added
m Permissions: not a typo template to avoid spellchecker
GID of files can be set arbitrarily
Line 127:
File system security within [[UNIX]] and [[Unix-like]] systems is based on 9 permission bits, set user and group ID bits, and the [[sticky bit]], for a total of 12 bits. These permissions apply almost equally to all filesystem objects such as files, directories and devices.
 
The 9 permission bits are divided into three groups of three bits each. The first group describes the permissions of the file owner, the second group describes the permissions of athe [[Group identifier|GID]] assigned to the file, which by default is the group associated with the file owner or the directory containing the file when it is ''[[setgid|set-GID]]'', and the third group describes the permissions associated with any process which does not have the same user ID as the file. Each group of three bits contains a bit indicating the read, write or execute access is granted. In the case of directories, execute access is interpreted as the permission to perform a filename lookup within the directory.
 
The set user ID and set group ID bits, commonly abbreviated ''set-UID'' and ''set-GID'' respectively, are used to change the identity of the process which executes a file having either or both of those bits set. A file having the ''[[setuid|set-UID]]'' permission bit set will cause a process which executes that file to temporarily switch the effective user ID to that of the file owner. A file having the ''[[setgid|set-GID]]'' permission bit set will cause a process which executes that file to temporarily switch the effective group ID to that of the file group. A process may then alternate between the effective user or group ID which it inherited from the file and the real user or group ID which it inherited when the user logged on to the system. This provides a mechanism by which a process may limit the access rights it possesses to those code regions which require those access rights. This is a form of a security technique known as [[privilege separation]] and improves program security by limiting the unintended or undesirable actions of a processes.