Chmod: Difference between revisions From Online Manual

Jump to: navigation, search
(<noinclude>Category:SMF Terminology</noinclude>)
mNo edit summary
Line 1: Line 1:
The chmod command is found primarily on Unix-like machines. It is used to modify the permissions of a file or directory.
The chmod command is found primarily on Unix-like machines. It is used to modify the permissions of a file or directory.


Syntax: chmod mode file
Syntax: chmod mode file<br>
Example: chmod 766 readme.txt
Example: chmod 766 readme.txt


Each digit in the mode parameter represents the permissions for a user or a class of users. The first digit corresponds to the owner of the file. The second digit corresponds to the file's group. The final digit corresponds to everybody else.
Each digit in the mode parameter represents the permissions for a user or a class of users:
*the first digit corresponds to the owner of the file
*the second digit corresponds to the file's group
*the final digit corresponds to everybody else.
 


There are eight digits that can be used in the mode parameter.
There are eight digits that can be used in the mode parameter.
Line 16: Line 20:
*6 - Read and Write
*6 - Read and Write
*7 - Allow All
*7 - Allow All


On a web server, files are usually set to 644. This indicates that the file owner can read and write to the file, while everyone else can only read it. Directories are commonly set to 755. This indicates that the directory owner has full control, while everyone else can read and execute the files within it.
On a web server, files are usually set to 644. This indicates that the file owner can read and write to the file, while everyone else can only read it. Directories are commonly set to 755. This indicates that the directory owner has full control, while everyone else can read and execute the files within it.


In SMF, some files and directories must be writeable by users other than the owner for complete and proper operation. Examples include the Settings.php file and the attachments directory.
In SMF, some files and directories must be writeable by users other than the owner for complete and proper operation. Examples include the [[Settings.php]] file and the attachments directory.


<noinclude>[[Category:SMF Terminology]]</noinclude>
<noinclude>[[Category:SMF Terminology]]</noinclude>

Revision as of 13:51, 11 April 2011

The chmod command is found primarily on Unix-like machines. It is used to modify the permissions of a file or directory.

Syntax: chmod mode file
Example: chmod 766 readme.txt

Each digit in the mode parameter represents the permissions for a user or a class of users:

  • the first digit corresponds to the owner of the file
  • the second digit corresponds to the file's group
  • the final digit corresponds to everybody else.


There are eight digits that can be used in the mode parameter.

  • 0 - Deny all
  • 1 - Execute Only
  • 2 - Write Only
  • 3 - Execute and Write
  • 4 - Read Only
  • 5 - Read and Execute
  • 6 - Read and Write
  • 7 - Allow All

On a web server, files are usually set to 644. This indicates that the file owner can read and write to the file, while everyone else can only read it. Directories are commonly set to 755. This indicates that the directory owner has full control, while everyone else can read and execute the files within it.

In SMF, some files and directories must be writeable by users other than the owner for complete and proper operation. Examples include the Settings.php file and the attachments directory.



Advertisement: