How can I make sure that newly created files in a shared directory are owned by a specific group?

Updated -

In order to do this, you can set the shared directory's gid bit. The following commands should make any newly created files in the shared directory, /data/shared, owned by the group admins:

chgrp -R admins /data/shared
chmod 2775 /data/shared

Below is a sample session that illustrates the effect of setting the gid bit of a d...

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.