I want all new files created in one folder to have an owner called user1
How can I do that?
I want all new files created in one folder to have an owner called user1
How can I do that?
In FreeBSD exist suiddir(http://www.freebsd.org/cgi/man.cgi?query=mount&sektion=8). You may mount partitions with suiddir option and add 4000 permissions.
In linux GFS2 support suiddir. Also you may use cron or inotify, to change file owner.
You can have "all files belong to a group", by chmod g+s dir
If this doesn`t fit your needs, you have to deal with ACL and a default mask.
Hai Linux always associates a file or directory with a user and a group. For example, assume I have a file named webmaster.txt in my home directory. If I run the command ls -l webmaster.txt, I get the following result: -rw-rw-r- 1 root root 1024 Feb 21 15:10 example.txt
Here I think your directory is /root/test file is example.txt user is user1 & group is user1
If you want to change permission, gust follow the instruction
chown -R user1.user1 /root/test/
Best wishes
Although all the documentation seems to say otherwise, the sticky bit seems to do it to an extent.
e.g. to preserve the parent directory group.
chmod g+s [directory name]
Now any files or directories created within this directory inherit the parent group.
Not sure if this will be enough. Usually it's the owner/group of the current user or process that sets these.