In addition to the standard Read (r), Write (w), and Execute (x) permissions you've just learned, Linux uses a few "special" permissions for more advanced scenarios.
Here are the other types of permissions you might encounter:
1. Special Permissions (SSET)
These are used for specific system tasks and appear in the ls -l output in place of the x:
- SUID (Set User ID): When a file with SUID is executed, it runs with the privileges of the file owner rather than the person running it. (Symbol:
sin the owner's execute field, e.g.,-rws------). - SGID (Set Group ID): Similar to SUID, but the process runs with the privileges of the group owner. On directories, files created inside will inherit the directory's group. (Symbol:
sin the group's execute field, e.g.,-rwxr-s---). - Sticky Bit: Mostly used on directories (like
/tmp) to prevent users from deleting or renaming files owned by others, even if they have write access to the directory. (Symbol:tin the others' execute field, e.g.,drwxrwxrwt).
2. File Attributes (The "Immutable" bit)
Beyond standard permissions, Linux has "attributes" controlled by the chattr command.
- Immutable (i): If you set a file to immutable (
sudo chattr +i filename), nobody can modify, delete, or rename it—not even the root user—until the attribute is removed.
3. Access Control Lists (ACLs)
Standard permissions only allow you to set rules for one user and one group. If you need to give a second specific user access without making them the owner, you use ACLs.
- The commands
getfaclandsetfaclallow you to define complex permissions for multiple users on a single file.
4. Default Permissions (umask)
While not a permission type itself, the umask (user mask) is a system setting that determines the default permissions given to a file or directory the moment it is created.
Summary Table:
| Permission | Character | Description |
|---|---|---|
| Read | r |
View file content or list directory files. |
| Write | w |
Modify file content or create/delete files in a directory. |
| Execute | x |
Run a file as a program or enter/search a directory. |
| SUID | s |
Run with owner's privileges. |
| Sticky Bit | t |
Restricted deletion in a directory. |
For now, mastering r, w, and x is the most important step for any Linux user! Would you like to try changing permissions for a group or others next?