Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read that "Your files and directories are owned by the group (or one of the groups) that you belong to. This is known as their "group ownership"."

But what if a file/directory belongs to a group which the owner doesnt belong to?

I have such files and dont know if i have to change the group and what could be the consequences.

share|improve this question

migrated from Nov 29 '12 at 13:14

This question came from our site for professional and enthusiast programmers.

I'd suggest unix.SE instead of superuser.SE. Maybe some Mod can move? – Jonas Wielicki Nov 29 '12 at 11:38
sorry. i will overthink the next time where to put my question. – user1338413 Nov 29 '12 at 11:52
up vote 1 down vote accepted

In general, owner and group are completely independent. Normally though, in your home directory, your files belong to your own group except if you need them to be shared with another group (you possibly also belong to). A common usecase is an environment where a webserver serves the users ~/public_html directory but does not run as root. You'd then share that directory by assigning it the group of the webserver (often called apache, www or httpd) and granting that group the permissions to read the directory (chmod g+rx).

If you have such files, it would be helpful to know where you have these and (if you know that) to whom the group which is set on these files belongs. If you decide to change that group to your own, you'll change the conditions under which the files can be accessed, which can lead to tasks failing due to Permission Errors or even opening these files for unauthorized access (if others have more privilegues than group).

share|improve this answer
Your answer is far more complete than mine. – Sacx Nov 29 '12 at 11:39

Yes is possible. For example you can have the root user as owner and your group on a file. That doesn't mean root is in your group ...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .