Pages

atas horizontal

April 15, 2011

CHMOD, permission files on Linux

Twitter Facebook Digg Delicious Lintas Berita
This time I will tell about file permissions in linux .. if most users in the windows are not so concerned about the permissions of a file, in linux, linux users need to know about file permissions.Why so? If you are a beginner in linux, maybe you'll often see acces denied or when you copying file then want to paste the file but can not. It is certainly frustrating for us. this is due in three permissions which apply linux
- owner
- group
- universal

Linux is designed for multi-user, do not be surprised if in linux there are owner, group and universal.Permissions on files serves to regulate who can view, edit or execute files owned by us.This does not apply to the administrator because the administrator like a god in linux that can do anything about all users.

Standard Linux file permissions are rwx (r: read, w: write, x: execute)
why there are three rows of letters rwx? The first rwx are the permissions for the owner, the second to group and last to the universal.
rwxrwxrwx
   o       g       u
   w       r        n
   n       o        i
   e       u       v
  
r        p       e
                     r
                     s
                     a
                     l


every rwx denoted by the number 7, number 7 comes from the binary number 1 1 1 (r : 1, w : 1, x : 1) if the modified to decimal then it will become 7 decimal. See the example below,
to set file permissions in linux we use chmod, open a command line and enter the directory of our files.
if we want our files can be read, edited and executed by us, group or all users
we will write chmod 777 filename
if we want our files can be read, edited and executed by us, but the group or all users can not execute and edit it (can only be read)
we will write chmod 744 filename
if we want our files can be read, edited and executed by us, but the group or all users can not read, execute and edit it,
we will write chmod 700 filename

we can also write  
chmod +r file name to allow read in our file
chmod +w filename to give write access to our file
chmod +x flename to give access to execute on our file
to eliminate a right of access to our files we can type chmod-r /-w /-x filename
for ubuntu users you can set permissions on files by right clicking the file that will be regulated → click properties →then click the permissions tab.
for more detail please type man chmod in terminal.

0 comments:

Post a Comment