Server Fault is a question and answer site for system and network administrators. 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 have set a directory's SGID and every file created in this directory get the directory's group instead of the users one. That works perfect. But i want to do the same when a user edits the file. Right now when a user edits and saves the file, the file takes user's group instead.

Shouldn't SGID take care of this as well?

share|improve this question

SGID should take care of this. As far as file is created within directory with SGID it inherits its group. The same for files being copied to dir.

Maybe, this could be caused by the way editor updates file after being saved - for example, if it maintains temporary edit buffer elsewhere, then saves it and then moves it to directory (although it seems weird). In such case, files being moved to dir with sgid keep their original group.

share|improve this answer
the change in this file happens through sftp..maybe this has something to do with it?or i might have screw up sth supposed to work:/ – rootatwc Mar 24 '12 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.