Open sbonnegent opened 12 years ago
This script make a "wiki summary" of users / groups by targets
BASE=/opt/sshgate
echo "===== Les groupes =====" pushd $BASE/users.groups/ > /dev/null echo "^ Nom du groupe ^ Utilisateurs ^" for i in $(ls) do echo -n "| $i | " for j in $(cat $i) do echo -n "$j " done echo "|" done popd > /dev/null echo
echo "===== Les serveurs =====" pushd $BASE/targets/ > /dev/null echo "^ Nom du serveur ^ Login sur le serveur ^ Groupes ^ Utilisateurs ^" for i in $(ls) do cd $i echo -n "| $i | " FIRST_LOOP="True" for user in $(ls access.* | cut -d. -f3- | sort -u) do if [ "$FIRST_LOOP" == "False" ] then echo -n "| ::: | " fi echo -n "$user | " for group in $(cat access.groups.$user 2>/dev/null | egrep -v '^$' | sort) do echo -n "$group " done echo -n "| " for login in $(cat access.users.$user 2>/dev/null | egrep -v '^$' | sort) do echo -n "$login " done echo "|" FIRST_LOOP="False" done cd .. done popd > /dev/null echo
Is it possible, for a manager, to receive by mail a summary of users / targers / ACL (like command: user TOTO access notify) ?