Permission denied when uploading or creating file or folder with FTP client (AWS EC2 Litespeed Wordpress instance)

#1
I have installed WordPress with LiteSpeed Cache (Powered OpenLiteSpeed) on AWS EC2 instance. I need to install a font and create "fonts" folder inside theme folder. Unfortunately I always get "permission denied" whenever I try to upload or create a file or a folder with FTP clients (Filezilla or WinSCP)

FileZilla
Error: /var/www/html/wp-content/themes/astra/assets/fonts/Code200365k.ttf: open for write: permission denied
Error: File transfer failed

WinSCP
scp: /var/www/html/wp-content/themes/astra/assets/fonts/Code200365k.ttf: Permission denied


I've searched for solutions at Google and followed this guide but nothing worked
https://www.wpbeginner.com/beginner...you need to select,enter 644 in numeric value.
 

serpent_driver

Well-Known Member
#2
Some control panels doesn't allow to change permissions with local FTP application. If so, change permission with control panel file explorer or use console instead . That will work.
 
Last edited:

Unique_Eric

Administrator
Staff member
#3
The default document root folder is owned by www-data:www-data. If you use root, then you should have no permission issue during the upload, but you might need to manually change the whole document root folder with following command:
Code:
chown -R www-data:www-data /var/www/html
If you use other users, then you might need to add it to the www-data group.
 
#4
Thank you Eric & Serpent Driver for your replies.

I tried below 2 commands and receive "chown: changing ownership of '/var/www/html': Operation not permitted"
1) chown -R www-data:www-data /var/www/html
2) chown -R ubuntu /var/www/html

I use "ubuntu" as user (to login to WinSCP and Putty). I add sudo useradd -g www-data ubuntu, but "ubuntu" already exist.

Sorry I am total newbie. I appreciate your help.
 
Last edited:
Top