I've read a lot of solutions for something like this, but nothing seems to work quite right for me. I have a shared development box used for a few projects that require such a thing and I'd like to configure it so that files created by users in the /opt/dev directory:
- Are owned by
<username>:developers - Have permissions set to
774(files) - Have permissions set to
775(directories)
All developer users have their primary group set to developers so the first requirement has been pretty solid. What's a lot less solid is the actual permissions. They just aren't being set consistently the way we need them to get set and I haven't found the right solution.
I do have the sticky bit set (g+s) based on something else I read at some point, but that wouldn't seem to be particularly useful since all users are in the same primary group.
I also have the default umask set to 002 in /etc/login.defs. I thought that would kind of cover it, that doesn't seem to be the case.
I'd really appreciate any advice about how to get everything lined up properly. I feel like I'm constantly in there adjusting a file here and a directory there just so people can do their work.
umaskset to022as I don't. The value in/etc/login.defsis probably overwritten during boot. Reading here, if you typeumaskat the terminal, you'll see that you have only0002. That means that only thewritepermission forothersis forbidden (during the creation of files). And so it is. Try it in/tmpwith sometouchand a fewmkdir, and you should see it. – Avio Oct 05 '12 at 13:26