setgid ビットとは?
setgid ビットは 2 つの効果を持つ権限フラグです。実行ファイルに設定すると、プログラムはユーザーのグループではなくそのファイルのグループで実行されます。ディレクトリに設定すると、新しく作成されたファイルやサブディレクトリがそのディレクトリのグループを継承します。ディレクトリでの動作により、共有ワークスペースを一貫した 1 つのグループの下に保てます。setuid と同様に権限に影響するため、慎重に使う必要があります。
なぜ重要か
共有 build ディレクトリに setgid を設定すると、すべてのファイルが同じグループの下に保たれ、共同作業者がアクセスを維持できます。これを理解すると、グループの所有者が作成したユーザーと一致しないことがある理由が明確になります。
関連ガイド
What Is the Setuid Bit?The setuid bit makes an executable run with the privileges of its owner rather than the user launching it, of…
What Is the Sticky Bit?The sticky bit on a directory restricts file deletion so users can remove only their own files, even in a dir…
What Are Owner, Group, and Other Permissions?Owner, group, and other are the three permission classes Unix applies to each file, granting separate read, w…