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
---x--x--- 1 root stapusr    87992 Oct 20 23:44 staprun

What I showed above is the owner of file staprun. But user root doesn't belong to groupstapusr. What does it mean?

I assumed that before chown userxxx:groupxxx filename has been executed, the userxxx should belong to groupxxx .

share|improve this question

migrated from Oct 24 '13 at 6:06

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

Root is unfettered by such trivial details as 'does the user belong to the group'. At the o/s level, there is no such enforcement. – Jonathan Leffler Oct 24 '13 at 1:30

Of the user and group that owns a file, the user is not necessarily a member of the group.

share|improve this answer
Of course, only root (I'm pretty sure) can chown a file's group to something the user's not in. – Kevin Oct 24 '13 at 1:19
That's normally, but not necessarily, the case. It might be that the directory sets the group permission (SGID bit), while the user has write permission to the directory (perhaps public write permission, perish the thought, unless the directory has the sticky bit set; or perhaps because of ACLs). But in the normal case, a file is created belonging to the effective GID of the process that creates the file. – Jonathan Leffler Oct 24 '13 at 1:29

You must log in to answer this question.

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