tags:

views:

40

answers:

2

Hi, im looking for a find command to find all files under the / files that are suid and gid.

i got, find / ???. How can i use the find command to look for files under the / that have suid and gid.

Thanks

+2  A: 

setuid or setgid (GNU findutils):

find / -perm /6000

setuid or setgid (POSIX):

find / -perm -4000 -o -perm -2000

setuid and setgid:

find / -perm -6000
Sean Bright
`-perm /6000` doesn't seem to be posix: http://www.opengroup.org/onlinepubs/009695399/utilities/find.html. At least it doesn't work on my OS X laptop.
Alok
I've updated my answer.
Sean Bright
Nice. +1 from me.
Alok
find / -perm -4000 -o -perm -2000 > changes . Is there a way to run this under cron utility, at night (24). if it made any changes, mail this to [email protected]
su
A: 
find / -perm -u+s -o -u+g -type f
Alok