[OnCloud] Linux Permissions

Permission Denied when Deleting a File/Directory

In some cases when a PHP script is used to upload a file or create a directory on your Linux hosting account, the files will be owned by the PHP/Apache server. In such cases, you may not be able to delete the file/directory when using FTP. This can be corrected by changing the permissions using the myhosting.com File Manager.

You can access the File Manager from your Control Panel at https://support.myhosting.com,

  • Select Site Management 
  • Select Web Site Tools 
  • Select File Manager.

Alternately, you can access the Linux File Manager directly by browsing to http://your-domain.com/myfilemanager, replacing "your-domain.com" with your Linux account's domain name.

Using the File Manager, select the file or directory you wish to change permissions for, then click Permission.

 

Permission Denied error Rebuild or Publishing MovableType Blog

If you are getting "Permission denied at lib/MT/FileMgr/Local.pm line 104" error when you try to rebuild weblog or when you try to publish, the problem might be related to incorrect permissions set in your mt.cfg files.

You must use a full server path for the Local Site and Archive Paths in Blog Configuration | Core Setup section and make sure the blog/archive folder(s) you're pointing to exist with the correct permissions of set in your mt.cfg file as:

DBUmask 0022

HTMLUmask 0022

UploadUmask 0022

DirUmask 0022

If you have created your MovableType weblog folder under your docs/mt/weblog folder, then the "Local Site Path" setting will be:

/docs/mt/weblog

 

Setting File and Directory Permissions

Permissions are set using a command called CHMOD. CHMOD stands for CHange MODe. You are giving the host computer new instructions about this file or directory.

CHMOD comes as a set of 3 numbers. Each of these 3 numbers is a sum total of 3 other numbers. So you have to add 3 numbers to get the first CHMOD number, add 3 numbers to get the second CHMOD number and add 3 numbers to get the third CHMOD number.

 

Understanding the Numbers

Each digit is a number value from 0 to 7. The value specifies what capabilities are available (or not). These numbers correspond to 3 command types. Read, write and execute.

Read (r) has a value of 4. It allows listing files in the directory. Write (w) has a value of 2. It allows the addition of new files to the directory. Execute (x) has a value of 1. It allows access to the files in the directory.

Here are the possible combinations available using these command types :

 

Digit

rwx

Result

0

---

no access

1

--x

execute

2

-w-

write

3

-wx

write and execute

4

r--

read

5

r-x

read and execute

6

rw-

read and write

7

rwx

read write execute

OK... so you know each digit will be a number from 0 to 7, but what does the 3 digits stand for? 

The first number represents the host server. This will usually be set to 7 giving the host full permission on the files in the folder. The second number represents the group (YOU - the individual being hosted). And the third number represents the world (the visitors to the site). Normally, on free hosts, these two digits will be set to 4, allowing the reading (and displaying) of files. Thus, no executing capabilities.

Typical settings for files are 777, 755, 666 or 644. Typical settings for directories are 777 or 755. CGI scripts 755, data files 666, and configuration files 644.

 

How do you change the CHMOD?

The easiest way (for a user) is by using an FTP program. Most FTP programs have a button or right-click menu that allows you to set the CHMOD on a specific folder or file. Try right-clicking (clicking and holding for Mac users) on the file or folder to see if a menu option for file permissions/access exists, or read the help files.

Below is a screenshot of the visual file permissions setup for the CuteFTP client:

image:Chmod1.jpg?

image:Chmod2.jpg?

 

Was this article helpful?
1 out of 2 found this helpful