OpenLiteSpeed WordPress on GCP: Wordpress directory permission

I am trying to upload (modify, edit, delete ues) files to the directory with Wordpress using Filezilla. I can only use the local directory with my login name, but the Wordpress directory does not have permission to write to.

There are a few ways around this. You could upload them to a directory on the remote server that you do have access to, like your home directory, and then sign in through SSH and move the files over to the correct location (using sudo or by signing in with root).

Another alternative is to log in as the root user when connecting through SFTP by giving a command like `sftp root @ your_server_ip`. You would then have adequate permissions to transfer the files to the web root as you are attempting to do.

But this does not work for me.


Right, image come with the www-data user permission.
If you upload files/images though web admin, should be no issue.
If you upload files from SSH console or filezilla, you can put it to any folder, e.g. /opt/ first. Then move it to the /var/www/html/xxx with root user from SSH console, then change the permission with command
chown -R www-data:www-data /var/www/html
How upload files/images though web admin?

I tried to move files from a folder open for me along the path - / var / www / html / xxx - but Permission denied.
Could you step by step write how to do this?



I mean wp-admin(wordpress), not web admin.
Because you were not using a user name which is not belongs to that /var/www/html folder.

1. Transfer your files to your user's home folder
2. Then ssh in to the console with root permission, cp the /home/USER_NAME/UPLOADED_FILE to the location you need /var/www/html/xxx
3. Fix permission to the www-data by command `chown -R www-data:www-data /var/www/html`

Please substitute USER_NAME, UPLOADED_FILE, xxx to the real name