Skip to content
README.md 700 B
Newer Older
Marco De Donno's avatar
Marco De Donno committed
# 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
Marco De Donno's avatar
Marco De Donno committed
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)
Marco De Donno's avatar
Marco De Donno committed
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`:
Marco De Donno's avatar
Marco De Donno committed
    `session optional pam_exec.so <path_to_script>/pam_notify.sh`
Marco De Donno's avatar
Marco De Donno committed
8. For debian based OS, add the line from step 7 to the `/etc/pam.d/sudo` file
9. Have fun!