You are managing a directory shared by a project team. You want all files created in this directory to automatically belong to the 'developers' group, regardless of the user's primary group. Which command achieves this?
Trap 1: usermod -aG developers
This adds a user to a group, which does not automate inheritance.
Trap 2: chgrp developers /data
This changes existing group ownership, not inheritance for new files.
Trap 3: chmod 1777 /data
This sets the sticky bit, used to prevent file deletion by others.
- A
usermod -aG developers
Why wrong: This adds a user to a group, which does not automate inheritance.
- B
chgrp developers /data
Why wrong: This changes existing group ownership, not inheritance for new files.
- C
chmod g+s /data
The setgid bit on a directory forces group inheritance.
- D
chmod 1777 /data
Why wrong: This sets the sticky bit, used to prevent file deletion by others.