ACCESS RIGHTS IN LINUX
INTRODUCTION
In Linux systems have a file ownership or access rights of ownership and permissions. Access rights are the security file in the linux system. Linux is a multiuser operating system, which means that can accommodate many users as well. Because linux is an operating system that is multiuser system mechanism is needed to prevent the access rights of each file from each user.
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 |
from the example above shows that file1 is owned by the root user to change the ownership to the user anggit. Then how to change the group ownership is to use the chgrp command. The following example:
| [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 |
from the example above shows that file1 is owned by the group to change ownership to root anggit group. Here are the steps to change the file ownership and groups simultaneously. Example command:
| [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 |
from the example above shows that file1 is owned by the user and group anggit changed ownership anggit be user root and group root. If the file is found sometimes can not be terubah ownership using the command-R (recursive). Examples of uses as follows:
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:
Description:
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:
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:
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
That must be considered is the number of decimal places:
4 = r
2 = w
1 = x
Example usage:
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
| [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
File permissions in linux is very important to prevent users who do not berkentingan mengakases certain files. In the linux administrator or user is commonly referred to as super user or root. If we use this user will be able to access all the files there.
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)
if a file has execute permissions of the file can be run as an application. If it is a directory then all files in that directory can be run as an application program
CHANGING PERMISSIONS
Before changing the access rights needed to know the acronym stands for dugunakan in order to know the structure and attributes of a file.
Example:[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











Posting Komentar