Permissions are the Unix way of controlling access to resources such as files, directories and devices and may be specified for an owner, group, or all users.
Permissions on Unix-like systems are managed in three distinct classes. These classes are known as user, group, and others. In effect, Unix permissions are a simplified form of access control lists (ACLs).
There are three specific permissions on Unix-like systems that apply to each class:
- The read permission, which grants the ability to read a file. When set for a directory, this permission grants the ability to read the names of files in the directory (but not to find out any further information about them such as contents, file type, size, ownership, permissions, etc.).
- The write permission, which grants the ability to modify a file. When set for a directory, this permission grants the ability to modify entries in the directory. This includes creating files, deleting files, and renaming files.
- The execute permission, which grants the ability to execute a file. This permission must be set for executable binaries (for example, a compiled C++ program) or shell scripts (for example, a Perl program) in order to allow the operating system to run them directly. When set for a directory, this permission grants the ability to traverse its tree in order to access files, including file metadata, or subdirectories, but not list the files inside the directory (unless read is also set).
When a permission is not set, the rights it would grant are denied. Unlike ACL-based systems, permissions on a Unix-like system are not inherited. Files created within a directory will not necessarily have the same permissions as that directory.
- Execute vs Read bit. How do directory permissions in Linux work?
- How to set default file permissions for all folders/files in a directory?
- Redirecting stdout to a file you don't have write permission on
- Why do we use su - and not just su?
- How to create a file even root user can't delete it
- Two users with different permissions on same directory
- Clone ownership and permissions from another file?
- Understanding UNIX permissions and file types