chmod ddd filename
Every mode has a
corresponding 3-digit code number: ddd
Each digit of the
mode number sets the permission for individual's access by categories in
this order:
(u=user_owner, g=group and
o=other or world)
The digits are the sum of the permission numbers for each category of
individuals:
4 = r, (read
permission) 2 = w, (write
permission) 1 = x. (execute
permission) 0 = - (no permission for this user)
The permissions granted the individuals in each category is the sum of
the permission numbers.
Example: To set read
write execute for individuals defined as owner_user, To
set read no-write execute for individuals in the
group To set read no-write execute for all the
individuals in the world The calculation is as
follows:
Sum of permissions for u: rwx
=> 4 + 2 + 1 = 7 Sum of permissions for g:
r-x => 4 + 0 + 1 = 5 Sum of permissions for
o: r-x => 4 + 0 + 1 = 5
Which makes :
755
The command to accomplish this set of file
permissions:
chmod 755
filename
Directories:
Permissions for
directories.
read individuals can view
the directory's contents write individuals
can create new files or delete files in the
directory. (Note: an
individual with write access to a directory
can delete files in the
directory even without write
permissions for the
file.) execute individual can cd
into the directory.
================================================================= |