I am trying to re-configure much of my network and cant recall, or now find, how to force a directory to use a specific user.group when new files or sub-directories are created, even when logged in as root or another user. For instance, if I have the following
/home/stork (currently chown -R stork.stork) /home/german (currently chown -R german.german)
I would like to ensure that no matter who I am logged in as (root, stork, german), that all new files and directories get created with the same user.group as set above. Obviously only root having access to both, but when files or directories are created in either, the new object is created with the user.group set above.
Also, since these home locations are also exported via NFS and shared via Samba, I want the same behavior whether I am connecting from a Windows or Linux machine.
You can try setting the setgid bit on the directory (chmod g+s <dir>) such that all files created within that directory are owned by the directory's group owner. I don't think it'll work for user ownership, though.
--
*Richard Plana, B.Sc., CCNA* Linux Junkie
