Why Is a Linux File Getting a Different Group Name and Not The Group of the User That Created The File?

Problem scenario
A Linux user creates a file in a directory and no other manual commands are run. The file is associated with a group that is not the group of the user. What could be the reason?

The directory had a command like this run:

sudo chgrp group2 /path/to/directory

Then the set GID bit was configured. The chmod 2755 /path/to/directory command would set the GID bit because of the "2" in the numeric notation.

Subsequent files in this directory will get the group "group2".

(This was taken from page 268 of The Linux Bible.)

Leave a comment

Your email address will not be published. Required fields are marked *