Having a hard time getting permissions to create directories and files in www folder

Posted May 22, 2013 3.5k views
I followed the following guide here: and here: So now I have a LEMP stack which runs fine and I have my root account secured and a new username "adriano". If I SFTP into the server using the username adriano, I am unable to create any files or directories. Trying to do a simple wordpress install doesn't work because I need to be able to create a folder for it, and a wp-config.php file. Both of which, like I mentioned, I do not have permissions to do. Yes, the username "adriano" has been added to the sudoers file via visudo. I've never been very good at UNIX permissions so I was wondering if maybe someone can help me out? Also, since I am using nginx it does not seem like I have a www-data group or user and my www folder is /usr/share/nginx/ Thank you, AJ

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
Change the ownership of /usr/share/nginx and all of its subdirectories/files to adriano and the group owning it to www-data:
sudo chown -R adriano:www-data /usr/share/nginx

This will allow you to create files and allows nginx to read the files.