Unset setgid bit with chmod numeric mode
I've found it! This info is missing from the man page but is in the Coreutils manual online. To wit:
On most systems, if a directory’s set-group-ID bit is set, newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory. On a few systems, a directory’s set-user-ID bit has a similar effect on the ownership of new subfiles and the set-user-ID bits of new subdirectories. These mechanisms let users share files more easily, by lessening the need to use
chmod
orchown
to share new files.These convenience mechanisms rely on the set-user-ID and set-group-ID bits of directories. If commands like
chmod
andmkdir
routinely cleared these bits on directories, the mechanisms would be less convenient and it would be harder to share files. Therefore, a command likechmod
does not affect the set-user-ID or set-group-ID bits of a directory unless the user specifically mentions them in a symbolic mode, or uses an operator numeric mode such as ‘=755’, or sets them in a numeric mode, or clears them in a numeric mode that has five or more octal digits.
Reference: https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html