m (Robot: Changing Category:SMF Terminology) |
No edit summary |
||
(26 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:chmod}} | {{DISPLAYTITLE:chmod}} | ||
The chmod command is | {{TOCright}} | ||
<!-- The "onlyinclude" tags mark the section to be transcluded to the SMF Terminology Page (.../smf/SMF_Terminology) | |||
--> | |||
<onlyinclude><code>chmod</code> (short for '''''ch'''ange '''mod'''e'') is a command for changing permissions on files and directories. It is used only in servers with a Unix-like operating system, such as Linux. These permissions determine whether your forum's readers can see your site, and whether the SMF [[{{Latest docs}}Package_manager|package manager]] can patch or replace a file.</onlyinclude> | |||
SMF will work well with settings of 755 for directories and 644 for files -- on most webservers. If you have questions, check with your host for more information about how your webserver is set up. Some webhosts allow permissions of 777 on directories and 666 on files. On other hosts, these settings will cause 500 errors when anyone tries to look at your SMF website. | |||
<code>chmod</code> file permission settings come with three digits (644, for example), which represent permissions for the '''o'''wner, '''g'''roup, and '''w'''orld. These settings control what programs running on your website's computer can do with the files, depending on what user that program is "logged in" as. | |||
If the webserver runs your website as though it were logged in as you, only the '''owner''' permissions (first digit) matter. If it runs as "nobody", then only the '''world''' permissions (third digit) matter. | |||
In order to install a [[modification|modification package]], SMF needs to edit some files, replace others, add files to existing directories, and even create new directories full of files. To do this, it needs the permissions to be set high enough to allow this. This is why the SMF [[package manager]] comes with a [[{{Latest docs}}Package_manager#File_Permissions|File Permissions]] tool. When you use the file permissions tool, you will be setting <code>chmod</code> file permissions. Depending on how your host is set up, SMF may need to use your [[FTP_-_How_do_I_use_FTP|FTP]] login to complete this task. Alternatively, you can log in using FTP and do this yourself, or (if your host allows it) you can use telnet or SSH to log in and use the <code>chmod</code> command. | |||
Since <code>chmod</code> depends on who owns the files and who is trying to use them, file ownership is important. If you run into problems where you are sure you have correct <code>chmod</code> permissions, but SMF does not seem to have permission to do something (like install a mod), then find out who owns the files. If you are confused about file ownership and what user the webserver runs as on your site, talk to your host. In some cases, you will need to <code>chown</code> (change ownership) the file ownership settings for a file, and you may need your host's help for that. | |||
==Using chmod on the Unix Command Line== | |||
Syntax: chmod mode file | |||
Example: chmod 766 readme.txt | Example: chmod 766 readme.txt | ||
==chmod Codes== | |||
Each digit in the mode parameter represents the permissions for a user or a class of users: | 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 first digit corresponds to the owner of the file | ||
*the second digit corresponds to the file's group | *the second digit corresponds to the file's group | ||
*the final digit corresponds to everybody else. | *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 35: | ||
*1 - Execute Only | *1 - Execute Only | ||
*2 - Write Only | *2 - Write Only | ||
*3 - Execute | *3 - Execute + Write | ||
*4 - Read Only | *4 - Read Only | ||
*5 - Read | *5 - Read + Execute | ||
*6 - Read | *6 - Read + Write | ||
*7 - | *7 - Read + Write + Execute | ||
Examples: | |||
#You set your directory permissions to 755. This means that the directory owner can read, write, and execute, while group and world can read and execute (use) the directory. | |||
#You set your file permissions to 644. This means that the file owner can read and write (edit) the file, while everyone else can only read it. | |||
==SMF Files or Directories that Must be Writable by the Webserver== | |||
{{SMF files and directories}} | |||
[[category:FAQ]] | |||
[[Category:SMF terminology]] | [[Category:SMF terminology]] | ||
Latest revision as of 15:35, 27 May 2015
chmod
(short for change mode) is a command for changing permissions on files and directories. It is used only in servers with a Unix-like operating system, such as Linux. These permissions determine whether your forum's readers can see your site, and whether the SMF package manager can patch or replace a file.
SMF will work well with settings of 755 for directories and 644 for files -- on most webservers. If you have questions, check with your host for more information about how your webserver is set up. Some webhosts allow permissions of 777 on directories and 666 on files. On other hosts, these settings will cause 500 errors when anyone tries to look at your SMF website.
chmod
file permission settings come with three digits (644, for example), which represent permissions for the owner, group, and world. These settings control what programs running on your website's computer can do with the files, depending on what user that program is "logged in" as.
If the webserver runs your website as though it were logged in as you, only the owner permissions (first digit) matter. If it runs as "nobody", then only the world permissions (third digit) matter.
In order to install a modification package, SMF needs to edit some files, replace others, add files to existing directories, and even create new directories full of files. To do this, it needs the permissions to be set high enough to allow this. This is why the SMF package manager comes with a File Permissions tool. When you use the file permissions tool, you will be setting chmod
file permissions. Depending on how your host is set up, SMF may need to use your FTP login to complete this task. Alternatively, you can log in using FTP and do this yourself, or (if your host allows it) you can use telnet or SSH to log in and use the chmod
command.
Since chmod
depends on who owns the files and who is trying to use them, file ownership is important. If you run into problems where you are sure you have correct chmod
permissions, but SMF does not seem to have permission to do something (like install a mod), then find out who owns the files. If you are confused about file ownership and what user the webserver runs as on your site, talk to your host. In some cases, you will need to chown
(change ownership) the file ownership settings for a file, and you may need your host's help for that.
Using chmod on the Unix Command Line
Syntax: chmod mode file
Example: chmod 766 readme.txt
chmod Codes
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 + Write
- 4 - Read Only
- 5 - Read + Execute
- 6 - Read + Write
- 7 - Read + Write + Execute
Examples:
- You set your directory permissions to 755. This means that the directory owner can read, write, and execute, while group and world can read and execute (use) the directory.
- You set your file permissions to 644. This means that the file owner can read and write (edit) the file, while everyone else can only read it.
SMF Files or Directories that Must be Writable by the Webserver
- /attachments
- /cache