keyplyr
11-28-01, 11:16 AM
Essentially, the "chmod" utility breaks down the 9 fields of permissions into three numbers (owner rights, group rights and world rights) such that each number defines three fields (readable, writable, and executable).
The break down follows the following scheme:
If a file is readable, it gets 4 points.
If it is writable, it gets 2 points.
If it is executable, it gets 1 point.
The total number of points will define its access privileges.
Code Explanation:
0 - No permission for anything
1 - executable only. Used rarely for executable application or directory
2 - writable only. Rarely ever used
3 - writable and executable only. Rarely, if ever, used.
4 - Readable only. Good for HTML files. If you store them as read only, then they are rarely lost if someone accidentally or intentionally attempts to delete them. Not so useful for directories
5 - Readable and executable but not writable. Used for CGI scripts that should not be modified or deleted after they work. Also good for directories
6 - Readable and writable but not executable. Okay for files that you are working on, but it is best not to store files in a writable form for your own safety.
7 - Readable, writable and executable. The wad. Just be very, very careful, especially if you have something writable AND executable in a CGI directory
The break down follows the following scheme:
If a file is readable, it gets 4 points.
If it is writable, it gets 2 points.
If it is executable, it gets 1 point.
The total number of points will define its access privileges.
Code Explanation:
0 - No permission for anything
1 - executable only. Used rarely for executable application or directory
2 - writable only. Rarely ever used
3 - writable and executable only. Rarely, if ever, used.
4 - Readable only. Good for HTML files. If you store them as read only, then they are rarely lost if someone accidentally or intentionally attempts to delete them. Not so useful for directories
5 - Readable and executable but not writable. Used for CGI scripts that should not be modified or deleted after they work. Also good for directories
6 - Readable and writable but not executable. Okay for files that you are working on, but it is best not to store files in a writable form for your own safety.
7 - Readable, writable and executable. The wad. Just be very, very careful, especially if you have something writable AND executable in a CGI directory