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

May 22, 2013 3.1k views
I followed the following guide here: https://www.digitalocean.com/community/articles/initial-server-setup-with-arch-linux and here: https://www.digitalocean.com/community/articles/how-to-install-lemp-nginx-mysql-php-stack-on-arch-linux 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
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.
Have another answer? Share your knowledge.