caps lock caps lock - 1 year ago 105
Linux Question

check owners of run control scripts

To secure my computer I want to be sure that only "root", "sys", "bin" are owners of run control scripts..

This is what I get so far :

find -L /etc/rc* -ls | awk '$5 !="root" { print $0 }'

is there a better way to achieve this ?

Answer Source

To find all files not owned by root use:

find -L /etc/rc* ! -user root

To check for all three user names named in the question use:

find -L /etc/rc* ! -user sys -a ! -user sys -a ! -user bin
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download