Ngnix - write: permission denied when transfering files with Filezilla to root directory

user3046831 picture user3046831 · Jan 19, 2014 · Viewed 8.5k times · Source

I am trying to transfer files with Filezilla to the root directory (/usr/share/nginx/www) of my nginx VPS via SFTP. The data-transfer fails with the following error-message:

/usr/share/nginx/www/test.php: open for write: permission denied

I am not using the root user, but created a user with sudo-rights to access my server.

I already tried to get www-data group permissions for my user with the following commands, however, without success:

sudo newgrp www-data

sudo usermod -a -G www-data myuser

Any idea how to get write permissions to transfer my files?

Answer

user3046831 picture user3046831 · Jan 20, 2014

The following command finally gave me the required permissions:

sudo chown username /usr/share/nginx/www