A user, "jdoe", has a primary group of "jdoe" and is also a member of the "editors" group. The user navigates into the /data directory, which shows these attributes:
drwxr-sr-x 2 root editors 4096 Jul 30 10:00 /data
The user then creates a file named draft.txt inside /data. Which group will own draft.txt?
The group owner will be "editors". The "s" in the group-permission field (r-s) indicates the setgid bit is set on /data. When this bit is present on a directory, the kernel assigns the directory's group to any file or subdirectory created within, regardless of the creator's primary group. The process's Effective Group ID (EGID) does not change; only the new file's group ID is inherited from the parent directory. Without the setgid bit, the file would have inherited the creator's primary group instead.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the setgid bit in Linux?
Open an interactive chat with Bash
How does the Linux kernel handle group assignment when the setgid bit is set?
Open an interactive chat with Bash
What would happen if the setgid bit were not set on a directory?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access