1
General Discussion / (PAM) Howto setup login-notifications
« on: January 28, 2023, 06:54:30 pm »
Hey folks,
I've setup a bash script on all of my machines, which sends a notification via curl to a REST-API every time a login happens.
Adding:
On Linux in /etc/pam.d/common-session makes the script to execute whenever a user logs in or starts a new session on the system. However I couldn't find any corresponding file on OPNsense :/
I've already tried
On FreeBSD PAM seems different and especially with the special OPNsense configurations (e.g. for 2FA "inside" your password) I just can't find out howto achive this.
Any ideas are highly appreciated!!
I've setup a bash script on all of my machines, which sends a notification via curl to a REST-API every time a login happens.
Adding:
Code: [Select]
# login notifications
session optional pam_exec.so seteuid /usr/local/bin/common-notify.sh
On Linux in /etc/pam.d/common-session makes the script to execute whenever a user logs in or starts a new session on the system. However I couldn't find any corresponding file on OPNsense :/
I've already tried
- /etc/pam.d/system
- /etc/pam.d/sshd
- /etc/pam.d/login
- /usr/local/opnsense/service/templates/OPNsense/Auth/system.pam
On FreeBSD PAM seems different and especially with the special OPNsense configurations (e.g. for 2FA "inside" your password) I just can't find out howto achive this.
Any ideas are highly appreciated!!