You are not logged in.

#1 2021-07-14 14:54:36

Xwang
Member
From: EU
Registered: 2012-05-14
Posts: 414

Get email when someone logins or pc restart

Hi,
I would like to receive an email every time someone logins, unlock or reboot my pc.
I've read this old thread:
https://bbs.archlinux.org/viewtopic.php?id=149634
and I wonder if with systemd is there any other way to do that.
Xwang

Offline

#2 2021-07-14 15:21:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,432

Re: Get email when someone logins or pc restart

For logins you can use pam_exec, see eg. http://blog.th-neumeier.de/2011/02/send … using-pam/ (this is not restricted to ssh, it just gets annoying for local logins, I guess)
For reboots, see https://wiki.archlinux.org/title/Power_ … stem-sleep
Not sure about reboots, but system-shutdown will inform you whenver that happens (and a reboot is a shutdown w/ a special ACPI hint. One could just shutdown and push the power button to evade a reboot specific hook)

Offline

Board footer

Powered by FluxBB