Newer
Older
# PAM notifier
This bash script is triggered at each ssh connection or sudo usage. A message is send to a mattermost chatt room with a summary of the connection or the sudo command.
# Installation
1. Git clone this repository
2. chown root:root pam_notify.sh
3. chmod 0700 pam_notify.sh
4. Add the mattermost url (with the incoming webhook) to the file `/etc/pam.d/hook` (without newline at the end of the file)
5. chown root:root /etc/pam.d/hook
6. chmod 0400 /etc/pam.d/hook
7. Add the following line to the `/etc/pam.d/common.session`:
`session optional pam_exec.so <path_to_script>/pam_notify.sh`
8. For debian based OS, add the line from step 7 to the `/etc/pam.d/sudo` file
9. Have fun!