All files and directories have an owner, and are part of a group.
Each file therefore defines permissions for:
Basic permissions are:
Listing file rights
ls -al : -al allows to list the rights of files, including hidden ones.
rwxr-xr--
\ /\ /\ /
v v v
| | rights of other users (o)
| |
| rights of users belonging to the group (g)
|
owner's rights (u)
$ ls -al
total 192
drwxrwxr-x 18 yolo yolo 4096 janv. 25 14:23 . : rights of the current directory
drwxrwxr-x 26 yolo yolo 4096 févr. 5 10:55 .. : parent directory rights
-rw-rw-r-- 1 yolo yolo 5917 janv. 25 14:23 readme.txt : read/write User/Group, read only for Other
-rwxr-xr-x 1 yolo yolo 2642 janv. 25 11:31 run : read/write/execute for user, read/execute for group and others
Additional permissions exist:
$ ls -al
total 192
drwxrwxr-x 18 yolo yolo 4096 janv. 25 14:23 .
drwxrwxr-x 26 yolo yolo 4096 févr. 5 10:55 ..
rwsr-xr-x 1 yolo yolo 2642 janv. 25 11:31 run : the x is replaced by an s for User
The SUID bit allows us to launch commands with the rights of another user and make privilege elevation.