Thursday, June 26, 2014

Unix/Linux file permissions

Unix file permissions Notation

There are two type of file permission notation Symbolic and Numeric.

Symbolic notation 

Unix permissions are represented by several ways. In which user will know the access permission of particular files and directories.

There are Three permission triads.

 first triad for => what the owner can do
 Second triad for => what the group members can do
 Third triad => what other users can do
 r means readable
 w means writable
 x means executable

 r is for reading is permitted otherwise - if it is not allow.
 w is for writing is permitted, - if it is not allow.
 x is for execution is permitted, - if it is not allow.


Numeric notation

Numeric Unix permissions notation is an octal (base-8). This notation includes of at least three digits. The component of the permissions is owner, group, and others respectively.
The read bit adds 4 to its total   (in binary 100)
The write bit adds 2 to its total  (in binary 010)
The execute bit adds 1 to its total (in binary 001)

 Symbolic Notation Numeric (Octal) Notation English
 --wx-wx-wx 0333 write & execute
-r--r--r-- 0444 read
-r-xr-xr-x 0555 read & execute
-rw-rw-rw- 0666 read & write
-rwxrwxrwx 0777 read, write, & execute

Ex.
Triplet for u: rwx => 4 + 2 + 1 = 7
Triplet for g: r-x => 4 + 0 + 1 = 5
Tripler for o: r-x => 4 + 0 + 1 = 5
Which makes : 755

No comments: