Hey,
I spun up a new droplet right before the weekend and have been working on setting it up properly for my very small team. I’ve read a multitude of posts on StackOverflow and ServerFault about how to properly configure the “/etc/www/html” folder permissions.
I can get what seems like proper permissions for my own user, however when I try to log in to another user, they get permission denied regardless if we’re in the same group or not.
What I’m aiming at is properly securing the /etc/www/html folder without breaking anything for the www-data user (I’ll manually chmod any folder it needs write access to for uploads and such) and giving the group “webmasters” read/write access on “/etc/www/html” so that they can work in it. (Editing files, uploading, etc.)
Can anyone help me out?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi Dizzzy,
From what I understand, you want to allow multiple users to edit the same directory, is that correct?
*There are two ways to do this : *
Add the users to the www-data’s group
You can create new users and add them to the www-data’s group. That way the new users will have read/write access to the folders with ownership www-data.
You’ll start by creating the user by using the adduser command
sudo adduser exampleuser
Next step would be to add the new User Account to the needed the relevant group
sudo usermod -a -G examplegroup exampleusername
Where the examplegroup is www-data.
Add the users to the sudoers group
You’ll start by creating the user by using the adduser command
sudo adduser exampleuser
Then use the usermod command to add the user to the sudo group
sudo usermod -aG sudo exampleuser
Lastly, you can use test if everything was done correctly by using the su command
sudo su - username
Once you are run you can execute something like:
sudo ls -la /etc/www/html
If the directory is listed then you are good to go.
There is something I like to point it. If you add your users to the sudoers group, they’ll have access to all files on your server not just /etc/www/html. If this is not something you want, I would suggest using the first method.
Kind regards, Kalin D.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.