Management of permissions and users
The permissions are shown in the first block of the result. In the example above it would be drwxr-xr-x
.
Permissions can be separated as follows:
Mode type
Permissions types:
r-–
-> read permissionrw-
-> read and write permissionrwx
-> read, write and execute permission
Permissions have numeric values:
r = 4
w = 2
x = 1
Owner | Group | World |
---|---|---|
rwx | r-x | r-x |
1 1 1 | 1 0 1 | 1 0 1 |
Octal mode
Octal | Binary | Permissions |
---|---|---|
0 | 000 | --- |
1 | 001 | --x |
2 | 010 | -w- |
3 | 011 | -wx |
4 | 100 | r-- |
5 | 101 | r-x |
6 | 110 | rw- |
7 | 111 | rwx |
Owner | Group | World |
---|---|---|
rwx | r-x | r-x |
1 1 1 | 1 0 1 | 1 0 1 |
7 | 5 | 5 |
Symbolic mode
Symbol | Meaning |
---|---|
u | only for the user |
g | only for the group |
o | only for all others (it's the world) |
a | applies to everyone |
To grant permissions we must give it a number that is the sum of each of these three letters:
To assign the permissions, the number must be given for both the owner, the group and the public.
Change permissions
chmod [number] <file>
-> allows you to change the permissions to a file
Run as super user
Last updated