Email Alert at PVE web login and terminal

koulis1234

Active Member
Jul 23, 2017
16
1
43
76
I would like to send mail to root anytime any user logs in via the web dashboard or by any other way (terminal ssh etc)

I would really appreciate a hint on this!!
 
Hi,

You must create a script like this /etc/profile.d/email-on-logon.sh

Code:
#!/bin/bash
/usr/bin/mail -s "new-root-login" user@domain.tld < /dev/null
# it works for guletz ;)
 
what triggers the script for PVE authentication? I can trigger it if someone authenticates with PAM
 
I can only gues, that you can find this info in /var/log/syslog on the master node, like for pam auth:

pveRO1 pvedaemon[2810]: <root@pam> successful auth for user 'root@pam'