1

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.

4
  • What is the FTP server running on your VPS ?
    – user9517
    Sep 16, 2011 at 16:54
  • 1
    Which FTP server are you running, post the configuration file?
    – quanta
    Sep 16, 2011 at 16:54
  • Most FTP servers I've used have a configuration option to block deletion of files.
    – DerfK
    Sep 16, 2011 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, 2011 at 9:10

4 Answers 4

3

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

3

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.

1
  • The permission of the parent directory is set to 755. Can't change it as well...
    – Levani
    Sep 17, 2011 at 9:11
1

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.

0

post the

ls -la image.jpg

and try do something like that:

  1. create some file in this dir
  2. delete this file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .