I want to do the following:
- Need to find all world writable files and folders from
/
root. - If found, I need to check whether the sticky bit is set or not.
- If the sticky bit is not set, then set it.
Can we come up with a command line solution for this type of problem?
Best Answer
You can do this using
find
's-perm -mode
format. Fromman find
:So, to find all files that are world writeable, irrespective of what other permissions they have, you can do:
To set the sticky bit, use
-exec
: