fuzzylizard Posted March 22, 2003 Report Share Posted March 22, 2003 For a group project that I am doing for school, I have set up a directory under my home and have changed the group for it to the group id that my group is using. However, we are having a problem, for some reason, in some directories under the group one, if someone creates a new file, or modifies an existing file, the owner/group id's are set to: owner - the person who created the file group - the id of the group. The problem is that for some other directories, if you create, or modify, a file, the owner/group ids are set to the person who last worked on the file. This means we are having to constantly change the group the file belongs to. SO, the question is this: 1. Why the difference in behaviour between the different directories 2. How to make any directory default to the group id Thanks. Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted March 24, 2003 Report Share Posted March 24, 2003 Good question. I don't have the answer. The best I could achieve is this solution (in my case, the directory is /local/share): - First, for all my users, I set the umask to 002, which is easily done by adding the following line to /etc/profile: umask 002 . That way, permissions for group and user should be the same. - Next, now and then, I check that all directories under (and including) /local/share have the s bit, so that files (but not directories...) created under have the same user, group, and permissions: # chown -R root.share /local/share # find /local/share -type d -exec chmod 6775 {}; where "share" is the group, all users having access to this place, belong to. Yves. Quote Link to comment Share on other sites More sharing options...
baudolino Posted March 29, 2003 Report Share Posted March 29, 2003 Not just sure I understand the problem, but here is a solution. Set the sgid bit for the top directory (chmod 2xyz, where xyz is the octal version of the current permissions). All the files created in the top directory (meaning any file in a directory in a directory in a .... in the top directory) will have the group id set to the group id of the top directory. baudolino sgid guru Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.