ACCESS RIGHTS IN LINUX
INTRODUCTION
CHANGING FILE OWNERSHIP
Every file in linux must have the attributes and description files. Now to see it can be done by using the ls command is as follows:
| [root@anggit root]#ls-l /home -rwxr-xr-x 1 root root 09 july 2009 /home/file1 |
Purpose of the above information by blocks:
-rwxr-xr-x = right of access of a file
root = user
root = group
09 july 2009 = date of making of file
/home/file1 = location of the file / filename
after seeing the example above it is a way to change ownership of files. Adapaun way is to chown command as follows:
| [root@anggit root]# ls-l /home -rwxr-xr-x 1 root root 09 july 2009 /home/file1 [root@anggit root]# chown anggit /home/file1 [root@anggit root]# ls-l /home -rwxr-xr-x 1 root anggit july 09 2009 /home/file1 |
| [root@anggit root]# ls-l /home -rwxr-xr-x 1 root anggit july 09 2009 /home/file1 [root@anggit root]# chgrp anggit /home/file1 [root@anggit root]# ls-l /home -rwxr-xr-x 1 anggit anggit july 09 2009 /home/file1 |
| [root@anggit root]# ls-l /home -rwxr-xr-x 1 anggit anggit july 09 2009 /home/file1 [root@anggit root]# chown root.root /home/file1 [root@anggit root]# ls-l /home -rwxr-xr-x 1 root root 09 july 2009 /home/file1 |
| [root@anggit root]# ls-l /home -rwxr-xr-x 1 root root 09 july 2009 /home/file1 [root@anggit root]# chown-R anggit.anggit /home/file1 [root@anggit root]# ls-l /home -rwxr-xr-x 1 anggit anggit july 09 2009 /home/file1 |
PERMISSION
Inside there are 3 linux permissions. Adapaun access rights are:
1. read (r)
if a file has read permissions of the file can only be read alone, using the cat command, vi, pico, etc.. But it can not be changed or deleted. If that is the directory can only see the contents of the directory using the ls command only
2. write (w)
if a file has write permissions of the file can be changed or deleted. If that is the directory that the directory can be deleted along with the files in it.
3. execute (x)
CHANGING PERMISSIONS
[root @ anggit root] # ls-l / home
-rwxr-xr-x 1 anggit anggit july 09 2009 / home/file1
Description:
- number 1 is the sign of a fileif - then it is usual file
- if d then it is a directory
- if l then it is a link
- number 2,3,4 is the ownership permissions of the user
- numbers 5,6,7 are the access rights of the group kempemilian
- number is 8,9,10 access rights of other property
Then a few abbreviations to keep in mind:
u = user
g = group
o = other
a = all (user, group, other)
+ = Add attributes
- = Reduced attribute
How to change the permissions and there are 2 methods using the chmod command:
Letter Methods
Example usage:
| [root@anggit root]# ls-l /home -rwxr-xr-x 1 root root 09 july 2009 /home/file1 [root@anggit root]# chmod g + w, o + w / home/file1 [root@anggit root]# ls-l /home -rwxrwxrwx 1 root root 09 july 2009 /home/file1 |
see the example above I modify the permissions of file1, first-rwxr-xr-x be-rwxrwxrwx.
Another example of how to change the file permissions:
| [root@anggit root]# ls-l /home -rwxrwxrwx 1 root root 09 july 2009 /home/file1 [root@anggit root]# chmod g-rwx, o-rwx /home/file1 [root@anggit root]# ls-l /home -rwx------ 1 root root 09 july 2009 /home/file1 |
see the example above I modify the permissions of file1,
before -rwxrwxrwx after -rwx ------
Method Numbers
Methods actual number is more to the concept of binary. See the table following standards:
Binary Decimal Permissions
4 = r
2 = w
1 = x
Example usage:
| [root@anggit root]# ls-l /home -rwx ------ 1 root root 09 july 2009 /home/file1 [root@anggit root]# chmod 754 /home/file1 -rwxr-xr-x 1 root root 09 july 2009 /home/file1 |
From the example above is changed terliha access rights:
Description 755 numbers:
7 derived from 4 + 2 + 1 = r + w + x => user access rights
5 comes from the 4 + 1 = r + x => access rights by group
5 derived from 4 = r => access rights by group










