Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I try to delete files from my ftp using filezilla I get the following error:

550 image.jpg: Permission denied

The file permissions on this image are 644, tried to change it with something higher but no success...

550 CHMOD 777 image.jpg: Operation not permitted

Tried to delete from plesk panel but the same.

Any ideas? I have a vps hosting with linux/centos.

share|improve this question
    
What is the FTP server running on your VPS ? –  Iain Sep 16 '11 at 16:54
1  
Which FTP server are you running, post the configuration file? –  quanta Sep 16 '11 at 16:54
    
Most FTP servers I've used have a configuration option to block deletion of files. –  DerfK Sep 16 '11 at 20:34
    
The permission of the parent directory is set to 755, however I've created this directory from php using this command "mkdir('/path/to/file', 0777)" but still it's set to 0755. Something strange is happening over my server. The ftp server is ProFTPD. –  Levani Sep 17 '11 at 9:10

4 Answers 4

You don't have permissions to the file. You aren't the owner of the file. Therefore, you cannot remove or change permissions on the file. Try this in a shell:

sudo rm -f image.jpg

share|improve this answer

When you delete a file, you don't modify that file, but you modify it's parent directory by removing filename->inode correspondence. File may have several names(hardlinks) in single filesystem. When inode link counter becomes 0, inode is freed. So you need to modify permissions for parent directory, not for file.

Second possible case is that in Linux filesystems file may have attributes, which can prevent it from being deleted. See man chattr for details.

share|improve this answer
    
The permission of the parent directory is set to 755. Can't change it as well... –  Levani Sep 17 '11 at 9:11
up vote 1 down vote accepted

I found the solution! The problem was caused because I was creating the parent folder of the file using php mkdir function. That folder was creating with the permission 755 regardless what I used as a second parameter for mkdir function. The solution is to add two magic lines before and after the mkdir function, like this:

$old_mask = umask(0);
mkdir($folder);
umask($old_mask);

I don't know exactly what they do but it works now. The parent folder has 777 permission and I can delete any files inside it.

share|improve this answer

post the

ls -la image.jpg

and try do something like that:

  1. create some file in this dir
  2. delete this file
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.