Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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

or

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
add comment

Your Answer

 
discard

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.