What is CHMOD?
Requested and Answered by Carnuke
on 2004/10/28 23:24:10
What is CHMOD?
CHMOD stands for ("Change mode") The Unix command and system call to change the access permissions of a named file. Each file (directory, device, etc.) has nine kinds of access which can be allowed or denied. Different permissions apply to the owner of the file, the members of the group the file belongs to, and world users. Each of these classes of user (owner, group and other) can have permission to read, write or execute the file.
From one to four octal digits
Any omitted digits are assumed to be leading zeros.
The first digit = selects attributes for the set user ID (4) and set group ID (2) and save text image (1)S
The second digit = permissions for the user who owns the file: read (4), write (2), and execute (1)
The third digit = permissions for other users in the file's group: read (4), write (2), and execute (1)
The fourth digit = permissions for other users NOT in the file's group: read (4), write (2), and execute (1)
The octal (0-7) value is calculated by adding up the values for each digit
User (rwx) = 4+2+1 = 7
Group(rx) = 4+1 = 5
World (rx) = 4+1 = 5
chmode mode = 0755
Allow read permission to everyone:
chmod 444 file
Make a file readable and writable by the group and others:
chmod 066 file
Allow everyone to read, write, and execute the file:
chmod 777 file
In a Xoops installation there are some files that need to be chmod directly after installation. This is usually achieved easily through your FTP client although it can also be done through your web server interface, such as cPanel.
These are the general CHMOD recommendations:
Directories in which the script needs to be able to create new files require 777, and files that the script needs to be able to modify require 666.
Directories that the script doesn't need to modify can be 755, and files that the script doesn't need to modify can be 644.
That's if the script runs as a user other than the user who owns the files, which is typically the case.
If the script (i.e., the web server) runs as the same user who owns the files, or if the server uses PHP Suexec, then the permissions can be tightened to 700 and 600.
The above applies to Unix servers, not Windows.
This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=128