FAPs (File Access Permissions)
Each file has three sets of permissions
The file owner
The Group user
Other Users
File Permissions are represented by these letters & numbers*
r which indicates read permission
also represented by the number 4
w which indicates write permission
also represented by the number 2
x which indicates execute permission
also represented by he number 1
What the file permissions mean:
Read - allows you to copy, compile and display a file
Write - allows you to edit, move, and rename a file
Execute - allows you to execute file
What the directory permission mean
Read - allows you to list the contents of a directory
Write - allows you to create new files, rename files, remove
files, create subdirectories, remove subdirectories,
move files, copy files
Execute - allows you to move to the directory, display the directory,
copy files from the directory. If do not have
the execute (x) permission for a given directory, you will
not be able to change to that directory
The first pattern of three is the Owner permissions
The second pattern of thee is the Group permissions
The third pattern of there is the Other Users permissions
To change the FAPs
To change FAPs the command chomd is used.
A + sign us used to grant a rwx permission.
A - sign us used to revoke a rwx permission.
The file owner is represented by the letter u.
The group owner is represented by the letter g.
Other users is represented by the letter o.
All users is represented by the letter a
Examples:
chmod g+x Customers [enter] - Gives group members execution permission
chmod o-r Sales [enter] - revokes read permission of the Sales file to
other users
chmod a-w march [enter] - revokes the write permission to the file
named arch to all users.
Using the Absolute numbers to modify FAPs.
In the Absolute the value listed below apply:
r read permission represented by the number 4
w write permission represented by the number 2
x execute permission represented by he number 1
Example - consider the following
drwxrw-r-x
Break down:
| Directory | 7 | 6 | 5 |
| Values = | r+w+x = 7 | r+w = 6 | r+x = 5 |
drwxrw-r-x is the same as 765
-rw---x--x is the same as 611
-rwxr----r is the same as 741
umask, mode, & File Access Permissions
Two values determine the FAPs.
The first is the mode value.
The second is the umask value.
mode value - umask value = FAP
666 is the default mode value for non-executable files.
777 is the default mode value for executable files and directories.
002 is the default umask value for users
022 is the default umask value for root users
Therefore the default value a user gets is 664 or -rw-rw-r--
value arrived at by the following
666 - 002 = 644 or -rw-rw-r--
Common umask values:
066 allows rw permission to user only -rw-------
666 - 066 = 600
006 allows rw permission to user & group only -rw-rw----
666 - 006 = 660
022 allows rw permission to user read permission to group users and
other users -rw-r--r--
666 - 022 = 644
026 allows rw permission to owner only, and read permission to group
666 - 062 = 604