File/Directory Permissions
- Unauthorized access to UNIX files and directories is controlled by granting read, write, or execute permission to the owner, group, or other user.
Owner = The person who Unix recognises as the file's owner.
Group = users defined as being in a particular group.
Other = Everyone else in the world, For this reason, the Other category is often called World.Read = View the file or directory without making changes.
Write = Make changes to the file or directory. In general, you never want to allow write access to anyone but yourself and your group.
Execute = Execute the file or directory. Generally used for directories, CGI programs, and files that include form actions.
- Permissions are shown when listing a file or directory using the -l option. The Screenshot below shows how this would look.
The Octal (Absoloute) Mode
- Octal mode is based on the base eight numbering system (0-7 are the available numbers).
Octal Value Permissions 4 Read 2 Write 1 Execute
- So basically....
OCTAL UNIX EQUIVALENT OWNER GROUP OTHER read/write/execute read/write/execute read/write/execute 777 rwxrwxrwx yes/yes/yes yes/yes/yes yes/yes/yes 755 rwxr-xr-x yes/yes/yes yes/no/yes yes/no/yes 744 rwxr--r-- yes/yes/yes yes/no/no yes/no/no 644 rw-r--r-- yes/yes/no yes/no/no yes/no/no
- The default permissions on files are 644 and the default permissions on directories are 755, Although this can be changed using the umask Filter.
- The chmod Command can be used to change file and directory permissions using both Unix (symbolic) and Octal mode.
For Example, to give the owner read/write/execute permissions and the group and world read-only permissions to a file called alan.html using Octal mode you would use the command:chmod 744 alan.html
And to give execute permission to the owner and read permission to group and world using Symbolic mode to a directory called britney you would use the command:
chmod u+x,go+r britney
Next'��`�[email protected]'��`�