'Cannot delete files on AWS EC2 via FTP, permission denied

I run a WordPress site on AWS EC2 with Litespeed.

When I log in via FTP I cannot delete anything, neither plugin nor theme files. FileZilla shows a rm /path/to/file permission denied error:

FTP rm permission denied screenshot



Solution 1:[1]

These are due to permissions issue, as you are trying to delete the files while loggged in from user that is not the owner of those files.That www-data is server user, ask your server provider to remove those files or change the owner of files.

Solution 2:[2]

For this issue, you need to change the owner of the files. This command will work for you

sudo chown -R www-data:www-data /var/www/html

Run this command from your ssh and try again.

Regards

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Majid Ali
Solution 2 Ansh Bhatia