Well, I know this is relatively old, but twalberg is correct: in fact, this is a relatively simple way to do this using the POSIX ACL. They existed from the late 90s - early 2000, so I do not know why more people do not use them.
How to do it: Do what you have already done, just run this command:
# setfacl -mg:god:rwx public private
and in one team you get what you want. You will spend forever trying to figure out how to do this using ONLY traditional unix permissions.
Mikic advice can still be good (depending on what you are trying to do), and it can be more straightforward to link as few groups as possible in your permissions (or maybe you want to make it clear that "chris" not an ordinary user, but an administrative user, again it depends on what you want to build).
I suggested something closer to what you are trying to execute, because there may be situations when you are trying to provide additional user / group access to the directory, but you do not want to choose between "chris" not to access these two directories, but chris will gain access to all other files and directories pub and priv that it can access. With ACLs, you donβt need to do these options, so they have been added and are now the main part of most Unix platforms (both BSD and Linux).
Bratchley
source share