Knowledgebase

KnowledgebaseCloud/VPSCloud HostingFile Management
Back to File Management

What Are Permissions On Files And Directories


A file/directory maintains three permission attributes: read (r), write (w), and execute (x).

Read permission lets you read the data from a file. Write permission lets you write new data to a file. Execute permission lets you use the file as a program or a shell script.

The same permission attributes apply to directories but they have a different meaning. If a directory has read permission, you can see what files are in the directory. Write permission to a directory means you can add, remove, or rename files in the directory. Execute permission (also called the "search bit") allows you to use the directory name when accessing files inside that directory.

You can use the File Manager to change the permissions for your files and directories.

permissionsicon.png

Usually, for web-readable files, the 'World' option will be set to Read, sometimes Execute but rarely Write Permissions.

worldpermissions.jpg

User Permissions

The User section defines the "user" that owns the file. For most files that you are using, this will be the username on your account. This means that when logged in as that user, you will have the permissions set in the User section.

Group Permissions

There can also be a "user group user group" (a set of users) that has certain permissions on a file. All users in that usergroup will have the permissions set in the Group section.

World or Other Permissions

The last section defines the permissions that any other visitor has over that file or directory. Essentially the rest of the Internet.

What permissions should my file have?

If the permissions on your files are either too strict or too loose, your website may have trouble running correctly. A good rule to follow is that most web-readable files should be set with the permissions 644 or Read and Write for the user, and Read-only for Group and World.

Directories should typically be 755 or Read, Write, and Execute for User, and Read, Execute for Group and World.

Depending on the application and the file type this may differ a bit. You will want to check the documentation for the application that you are using to ensure that you have the correct file permissions set.

More reading on Linux file permissions:

http://www.tuxfiles.org/linuxhelp/filepermissions.html
http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html



Related Articles

Am I Responsible For Monitoring My Bandwidth Usage
Can I Add My Own CGI Scripts
Can I Point My Primary Domain To A Sub-folder
Can I Reset My Website Files
Can I Use A .htpasswd File In My Account

Can’t Find what you need?

No worries, Our experts are here to help.