Email Alert at PVE web login and terminal

koulis1234

Active Member
Jul 23, 2017
16
1
43
74
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'
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!