Skip to content

Instantly share code, notes, and snippets.

@yradunchev
Created September 17, 2015 04:38
Show Gist options
  • Select an option

  • Save yradunchev/92ea87ddcd9e681809ad to your computer and use it in GitHub Desktop.

Select an option

Save yradunchev/92ea87ddcd9e681809ad to your computer and use it in GitHub Desktop.
Directory ACL Audit
#!/bin/bash
DAT=$( date +%Y%m%d%H%M )
printf "\n-----\CLIENTNAME GRP REPORT ${DAT}\n-----\n" > AUDIT_${DAT}.TXT
cat /etc/group | cut -d: -f1,4 | grep -E clientname_[a-z]+_ | sort | column -t -s: >> AUDIT_${DAT}.TXT
printf "\n\n-----\nCLIENTNAME ACL REPORT ${DAT}\n-----\n" >> AUDIT_${DAT}.TXT
find /SFTP_ROOT/CLIENTNAME/ -maxdepth 4 -type d -exec getfacl --tabular --omit-header --absolute-names {} \; >> AUDIT_${DAT}.TXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment