Question

I've recently moved to Digital Ocean after using shared hosting for years!

I'm loving the freedom to install and change anything I want, but I'm unclear about some things.

I'm using the LEMP stack installed on Ubuntu 12.04.4x64. I've followed This tutorial here to create a separate account "Archer" so I won't have to use the root account all the time.

Even though Archer has admin permissions I still couldn't edit files in the server using SFTP. SSH works, but not SFTP. So I made Archer owner of the folders I wanted to edit. In nginx.conf I changed the user from "www-data" to "Archer"

Now I have a few PHP scripts that save images in my server. They don't have permission to save those images anymore. Cronjobs aren't working either.

I am thinking they are all related and I messed up on something basic. I'd appreciate any and all help in the right direction!

Was it helpful?

Solution

I'd suspect a problem with changing the folders/files owner from "www-data" to "Archer", since that seems to be when the problems started. Try changing the owner back to "www-data" and see if that fixes the PHP scripts permissions problems.

THEN, if the new user Archer can't edit some files, I'd add the Archer user to a group that has permission to edit the files, use a command like usermod -a -G groupName userName (recommended here https://stackoverflow.com/a/7283086/3412074 or you could edit /etc/groups directly )

Adding Archer to the "www-data" group should work (it seems to be a standard group on Ubuntu-based things)

sudo usermod -a -G www-data Archer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top