I'm on Debian 8. While How to set default file permissions for all folders/files in a directory?  is about permissions, I'd like something similar for ownership.Whenever I login as root and add a file to a daemons config directory, the ownership of the newly created file is root:root. While this is OK for most situation, here it isn't. I'd like to have the ownership set to daemon:daemon automatically when I create a file somewhere under the config directory.How do I accomplish that?
How to set default owner per directory?
linux;permissions
You can't.You can use chmod to set the sticky bit on a directory (chmod g+s directory/) and that will cause all files created in the directory to be in the same group as the directory itself.  But that only affects the group, not the owner.You can also set your umask or ACLs on the directory to affect the default permissions of files created.But you can't automatically set the owner of a file you (root) created to some other user.  You have to do that with chown.You're just going to have to get used to the chown, chgrp, and chmod commands.