A A A
logo2




Access rights



Command ls –l show a lot of information about files and directories for egsample rights. Rights are presented:

d r w x r w x r w x


First place from left site Has a letter (d,l,c) Or it’s empty. Letter d means directory, l means link, empty place means that it is a file. Next three places are for user’s rights. If there is letter r on first place it means that user can read a file, if is empty user doesn’t have a right to read. If in second place is letter w it means that user can write a file, if is empty user doesn’t have a right to write. On third place there is a letter x and it mean execute.

d r w x r w x r w x


Next Three places are for group. Group are some userswho have the same rights. Like by user r-read, w-write, x-execute.

d r w x r w x r w x


Next Three places are other’s rights. Like by user r-read, w-write, x-execute.

d r w x r w x r w x




Change rights



Rights we can change In two ways:

If you would like to change rights you can use command chmod. Then you must give three numbers. First number is sum value of rights for user, seconds is a sum value of rights for group and third is for others. Right for read has a value 4. Right for write has value 2 and right for execute has 1. Then we give a pathname.

1 2 4 1 2 4 1 2 4
d r w x r w x r w x

owi@laptop:~$ chmod 764 nazwapliku

The example shows how to change rights: for user all rights, group can read and write and the others has only right to read.


If you would like to change rights you can use command chmod. Then you must write for who you change rights u-user, g-group, o-others. If you would like to add right write “+” or if you would like to take back a right write “–“. Then write which right r-read, w-write, x-execute. And at the end pathname to file.

owi@laptop:~$ chmod u+r nazwapliku

The example show how to give user right to read.

owi@laptop:~$ chmod u+r,g+w nazwapliku

The example show how to give user right to read and group right to write.


WARNING!
If you would like to change rights for directory and content use flag –R.


owi@laptop:~$ chmod -R 764 nazwakatalogu



Autor: Aleksandra Przybyło
aleksandraprzybylo@gmail.com