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

First I've been asked to change the owner of the current files in the folder and i chown'ed -R the path but i want to be sure that files which will be created there in the future will also be owned by the same user.

share|improve this question
You probably don't want to do that because then users can give away files that they can't take back. Whatever your outer problem is, it's probably better solved by group ownership of the files. – David Schwartz Nov 26 '12 at 12:20
up vote 0 down vote accepted

Assuming you only want to the be able to share files seamlessly between a group of users, on Linux you can set the 'set group id' bit on the directory:

chmod 2777 /shared


chmod g+s /shared

To make the files actually be owned by your user you would have to do some scripting. For example, running this find command suggested on wikipedia via a cron entry every minute.

share|improve this answer

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.