setgid
A permission bit that makes an executable run with the file's group identity, or makes new files in a directory inherit that directory's group.
A flawed setgid program can let users act with a privileged group's access.
In more detail
On an executable it grants the program the file's group privileges, with the same risks as setuid on a smaller scale. On a shared directory it is a convenience: files created inside belong to the project group rather than each user's primary group. In octal it is the 2 in a leading digit, as in 2770.
Related terms
- setuid — A permission bit on an executable that makes it run with the file owner's identity instead of the identity of the user who started it.
- effective user ID — The identity the kernel uses for a process's permission checks, which can differ from the real user ID of the person who started it.
- Unix group — A named set of users with its own GID, used to grant several people or services the same access to files.
- primary group — The group named in a user's account record, which new files the user creates belong to by default.
Taught in
- Setuid, Setgid, And Root Through sudo — Linux Fundamentals & Systems Administration
- Diagnosing Permission Problems — Red Hat Certified System Administrator (EX200) Exam Prep
- VFAT, ext4 And XFS: Create, Mount, Use — Red Hat Certified System Administrator (EX200) Exam Prep
- The Upload That Ran: Mount Options, Swap And Network Shares — CompTIA Linux+ (XK0-006) Exam Prep
- Root Over SSH From Anywhere: Keys, sshd, setuid Files And Attributes — CompTIA Linux+ (XK0-006) Exam Prep
- Mock Exam 101-500 — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems