Shell script to find all world-writable files and directories on Linux / UNIX system

in Categories Monitoring last updated April 10, 2008

Shell script to find all programs and scripts with setuid bit set on

in Categories Monitoring last updated April 10, 2008

Shell script to find all programs and scripts with setgid bit set on

in Categories Monitoring last updated April 10, 2008

setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable’s owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id or group id privileges provided are not always elevated, at a minimum they are specific.

setuid and setgid are needed for tasks that require higher privileges than those which a common user has, such as changing his or her login password. Some of the tasks that require elevated privileges may not immediately be obvious, though — such as the ping command, which must send and listen for control packets on a network interface.

Sample Shell Script