in reply to How do I generate a listing of all users who can access a directory?
for user in `awk -F: '{print $1}' /etc/passwd`; do echo $user; su - $user -c "ls -l /path/to/dir/" >/dev/null 2>&1; echo $?; done
Yeah I wrote it on the command line :) You might need to tweak for your system, skipping system accounts for example (awk -F: '$3>100{print $1}' /etc/passwd usually does it).
--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
|
|---|