On file and directory permission and ownership: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
mNo edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Needs work|experienced devs and customizers -- please fill in the blanks here}}
Installing SMF Packages requires either editing files or adding files and/or directories. Changing a file means reading a file and replacing it with a changed version of the file. All of Package Manager's changes to SMF's software require the permissions to read from, and write to, files and directories. Sometimes, package installation fails because of file permission problems. This page explains some of the common problems and offers some guidance on resolving them.
<!-- Why we care: How these issues affect SMF installations -->
Installing SMF Packages requires either editing files or adding files and/or directories. Changing a file simply means reading a file, then replacing it with a changed version of the file. All of Package Manager's changes to the SMF software require the permissions to read from and write to files and directories. Sometimes, package installation fails because of file permission problems. This document will attempt to explain some of the common problems and offer some guidance toward resolving them.
==File permissions and ownership==
<!-- What USUALLY works, with links to info about ftp and chmod already on the  wiki -->
On Unix-based systems, file permissions are changed using a utility called [[chmod]]. [[What is FTP|FTP]] servers generally provide a local command, also called chmod, to allow setting file permissions via FTP. If you are using an old-style command-line FTP client, you will have to use this command directly. But if you use one of the popular drag-and-drop style FTP clients (like FileZilla, cuteFTP or the FTP client built into Windows Vista and Windows 7), you will be able to view and change file permissions by checking and changing the properties of the files. If your web host provides it, you may be able to log in directly to the account using SSH or telnet and explore your files using Unix shell commands.


You should have permission to change the permissions on files you own. But you might not own all the files you think you own. In some cases, some of the files in your directories might belong to another user. Some ftp clients don't give you the information about file ownership. You may need to use a command-line based ftp or sftp client, or use SSH or telnet access to see all of this information about the files. On Unix-based operating systems, the chown utility is used to change file ownership. If files are not owned by the user account that should own them, this is often referred to as a chown problem.
==File Permissions and Ownership==
On Unix-based systems, file permissions are changed using a utility called [[chmod]]. [[FTP - How do I use FTP|FTP]] servers generally provide a local command, also called chmod, to allow setting file permissions via FTP. If you are using an old style command-line FTP client, you will have to use this command directly, but if you are using one of the popular drag-and-drop style FTP clients (like FileZilla, cuteFTP), you will be able to view and change file permissions by checking and changing the properties of the files. If your web host provides it, you may be able to log in directly to the account using SSH and explore your files using Unix shell commands.


To learn more about navigation your files using FTP, please read the FAQs [[How do I use FTP]] and [[What is installer/package manager FTP path]]. To find out if your host provides telnet or SSH access to your account, check your host's website or contact technical support. To learn more about using telnet and SSH, you may wish to check online manuals for these applications.
You should be able to change the permissions of files you own, but you might not own all the files that you think you do. It may be the case that some of the files in your directories might belong to another user. Some FTP clients do not give you information about file ownership. On Unix-based operating systems, the chown utility is used to change file ownership.


==What file permissions do you need==
To learn more about navigating your files using FTP, please read [[FTP - How do I use FTP|How do I use FTP]]. To find out if your host provides SSH access to your account, check your host's website or contact their technical support.
This is where it starts to get complicated. Different web hosts set up your account and the web server in different ways.
===SMF's recommended file permission settings===
<!-- SMF's recommended file permissions, and why SMF makes this recommendation -->
[[Recommendations|SimpleMachines recommends]] that you run SMF on a server where suphp or suExec is installed. If suphp or suExec is installed and configured properly on your web server, then all the files in your directory should belong to you, and the webserver will be able to read and write any files you can read and write. When the webserver creates a file in your directory, it belongs to you. In this case, only the file's owner needs permission to write to files and execute directories. CHMOD permission of 644 for files (owner:read+write, group:read, world: read) and 755 for directories (add the ability to "execute" directories) will be sufficient.


===When web hosts don't use suphp or suExec===
In this case, you still own files you create using ftp. Every time you use ftp to copy files to the server, they belong to you. But the webserver on these hosts does not run as you. It may run as "nobody", or else as a special username, perhaps "www-data" -- users who don't belong to the same group as your username does. This means that the webserver will not be able to write files in your directories unless you grant world write permission to your files and directories (chmod 777 for directories, 666 for files).  Any new files created don't belong to you. That means that, if you are going to need to work with them later, you'll need to make these files world-writable, and directories world-executable, so that you can edit the webserver's files or delete them from webserver-created directories.
===How can file permission and ownership cause problems===
* You install SMF via FTP so the files belong to you, but the webserver runs as someone other than you, or nobody , and so it cannot edit files via Package Manager.<br/>
Setting
* You install SMF via FTP so the files belong to you, and the webserver is supposed to run as you, but it has "accidentally" caused some files created via Package Manager to be created that are not owned by you, and now neither it nor you can do anything with them.
* Other cases?
===Causes and solutions for some common SMF problems===
Cases
* Package Manager says it installed a mod correctly, but the mod is obviously not there
** Cause
** Solution
* Package Manager syas it installed a mod correctly, and the mod seems to be only half there
** Cause
** Solution
[[Category:FAQ]]
[[Category:FAQ]]

Latest revision as of 13:45, 22 December 2015

Installing SMF Packages requires either editing files or adding files and/or directories. Changing a file means reading a file and replacing it with a changed version of the file. All of Package Manager's changes to SMF's software require the permissions to read from, and write to, files and directories. Sometimes, package installation fails because of file permission problems. This page explains some of the common problems and offers some guidance on resolving them.

File Permissions and Ownership

On Unix-based systems, file permissions are changed using a utility called chmod. FTP servers generally provide a local command, also called chmod, to allow setting file permissions via FTP. If you are using an old style command-line FTP client, you will have to use this command directly, but if you are using one of the popular drag-and-drop style FTP clients (like FileZilla, cuteFTP), you will be able to view and change file permissions by checking and changing the properties of the files. If your web host provides it, you may be able to log in directly to the account using SSH and explore your files using Unix shell commands.

You should be able to change the permissions of files you own, but you might not own all the files that you think you do. It may be the case that some of the files in your directories might belong to another user. Some FTP clients do not give you information about file ownership. On Unix-based operating systems, the chown utility is used to change file ownership.

To learn more about navigating your files using FTP, please read How do I use FTP. To find out if your host provides SSH access to your account, check your host's website or contact their technical support.



Advertisement: