Question

How do I revert the group ownership of www-data to default?

I entered sudo usermod -g www-data ftpuser

How do I return it to the default values? Is it owned by root? If so it would be:

sudo usermod -g www-data root?

How do i check the ownership of www-data?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Groups don’t have owners.

Your first command, sudo usermod -g www-data ftpuser made ftpuser’s default group into www-data. If you ran sudo usermod -g www-data root, you would, in kind, make the root user’s group be www-data. That’s not a good idea.

Groups do not have owners. Files and directories (folders) have owners. Users belong to groups, groups have members and every user has a default group, which is the group that gets applied to the POSIX permissions of any files or directories that user makes.

@MatthewDelfino

Ok, i see where i went wrong.

Now I did:

sudo usermod -g root root 

would make root back into the default group.

id root

uid=0(root) gid=0(root) groups=0(root)

Thanks for the explanation.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.