Provide upload rights to a user to a www directory
How to provide upload rights to a user to a www directory?If you have a Google Cloud instance running Centos-7, have setup SFTP on your machine and are now wondering how to provide access to the www folder to your www admin, here are the steps to follow.
Step 1 is to create a unique group, or use an existing group like "apache"
Next, add the group name to the folder you want to share, using
sudo chgrp -R apache
Step 3 is to add rwx permissions [read, write, execute] to the group, on the shared folder.
You can do that with the command
sudo chmod -R g+rwx
Finally, add the user with whom you want to share the folder to the group, using the command
usermod -a -G apache
After this is done, your user will be a part of the apache group, which will have read, write and execute permissions to the www folder.
You can add additional users to the group apache, which will allow them access to those folders, automatically.
Here is a link on allowing a group read write access to a directory
Here is a detailed explanation on how to add a user to a group