Artificial intelligent assistant

Copied file to have the same owner as its directory Let's say that * my user account is `homer` * there is a background service `marge` running an account `bart`. * `marge` is using a directory `lisa` for its data. * I have set the owner of `lisa` to `bart`. If I create a file and try to copy it to `lisa`, it fails due to permission. I can copy it by `sudo cp`, but then, the file's owner becomes `root`, which `bart` cannot read. I want the owner of all files in `lisa` to be `bart`. I can manually change the owner of the file to `bart` after copying it into `lisa`, but can't it be automatically done? That is, I want the owner of all files in `lisa`, no matter who copied/created them into `lisa`, to be `bart` by default.

If you add a setgid bit on the directory `bart` like `chmod 2775 bart; chgrp maggie bart`, then all files inside the directory will have group ownership changed to `maggie`, and add `bart` to the `maggie` group, then anyone who is in the group `maggie`, like you and `bart` will be able to access those files. There is a setuid concept for directories, but it is not implemented. The alternative is posix ACLs, which has pros and cons, but for what you need, setgid directories might work.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 43d9b180f6def8104023ffeb7fd21a3b