ATRUBUTES AND RIGHTS
A feature of Linux is that many users can be logged on the same hardware. Each of them can be assigned appropriate permissions to read and write or to run programs. These permissions are granted by the system administrator (root), who has access to all resources. Permissions are granted to the logged in user (owner), group and other people.
Attributes of the system element are in the form:
d – folder, – (minus) – file, l – dowiązanie
r – read, w – write, x – run, – (minus) – no rights,
Each entitlement shall have a numeric value assigned to it:
r - the rights to read the file - numeric value 4
w - rights to modify and save the file - numeric value 2
x - rights to run the file - numeric value 1
– - (minus) inaccessibility - numeric value 0
--- 0 no rights
r-- 4+0+0=4 read-only
rw- 4+2=6 read and write
rwx 4+2+1=7 read, write and run
r-x 4+1=5 read and run, cannot be modified
--x 1 run-only
Examples of message after command „ls -l”:
-rwx r-x r-x 1 marcin progr 512 juni 17 2017 14:07 sort
The user "marcin" in the group "progr" has full rights to the file "sort", while the members of the group and other people only to read and run without modification.
d r-- r-- r-- 2 karol win 12588 juni 7 2016 22:17 Temp
Everyone has only the right to read the contents of the "Temp" folder.
GRANTING OF RIGHTS
can be done by means of a 'chmod' command and a numerical notation.
Rights -rwx r-x r-x for a "sort" file we get by writing the command
Rights d r-- r-- r--for d r-- r-- r-- for a folder "Temp"
The command "chmod" can also be used in text version e.g.