Permissions

In a multi-user environment, security of user and system data is important. Linux has three specific, or distinct, classes:

  • r - read permission which grants the ability to read a file.

  • w - write permission which grants the ability to modify a file.

  • x - execute permission which grants the ability to execute a file.

The list above shows the symbolic notation of each permission in bold text. Each permission also has an octal notation:

  • r - 4

  • w - 2

  • x - 1

Primjer dozvola

To view permissions, type

ls -l ~/

which will output a list of the directories and files in the current user's home directory. For example:

drwxr-xr-x 2 username usergroup 4096 2009-12-17 11:10 Documents

The first column, which contains drwxr-xr-x, can be interpreted as follows:

Vrste datotekeKorisničke dozvoleDozvole grupiDozvole ostalim
d - directory rwx - read, write and execute permissions for the user. r-x - read and execute permissions for the group. r-x - read and execute permissions for all others.

Oktalno u simboličko

OktalnoSimboličkoOpis
0---Bez dopuštenja
1--xSamo za izvršenje
2-w-Samo za pisanje
3 (2+1)-wxPisanje i izvršenje
4r--Samo‑za‑čitanje
5 (4+1)r-xČitanje i izvršenje
6 (4+2)rw-Čitanje i pisanje
7 (4+2+1)rwxČitanje, pisanje i izvršenje