2
I have an Ubuntu VPS (LAMP) and manage PHP files from the folder www via SFTP.
I use Wordpress on my server, with it I upload folders and files and I can also delete them. Via Wordpress when I upload a new folder or file and later try to delete or edit the content of some file directly via SFTP the server returns me access denied. If I send the file or folder directly via SFTP the server allows smoothly.
Every time I upload a folder or file via Wordpress and need to change later manually the folder or files via SFTP, I need to run the following command so the server does not return me access denied:
sudo chown -R usuario:www-data /var/www
Why does this happen? Have I set the permissions incorrectly? When I use Wordpress to upload it generates the folder and files with different permissions?
The web server user is not the same as FTP, basically. One possibility would be to change the permission of the whole directory or at the time of the upload, to allow a wider access. But beware of shared hosting, because there may be improper access between users.
– Bacco