Originally posted by: SystemAdmin
The set-user-ID and set-group-ID bits on executable file permissions cause the effective user and/or group ID of the newly executed program to be set to the file owner or file group value, depending on which specific bit has been set. This allows a program to temporarily execute with the permissions of the user and/or group which owns that file. For example, if user
codebob[/code] owns file
codemyFile[/code] and user
codesue[/code] executes that file, the program begins execution with the permissions of
codebob[/code] and not
codesue[/code].
When the set-group-ID bit is set on a directory, all files and directories created within that directory, recursively, will have the same group as the directory. In addition, subdirectories will also have the set-group-ID bit set.