Auto update
Doug Hardie
bc979 at lafn.org
Sun Apr 11 07:41:03 UTC 2010
On 10 April 2010, at 23:14, Jos Chrispijn wrote:
> Can someone tell me if there is a way of generating an email on the moment that someone logs in to my FreeBSD server? The mail part (phpmail) will be easy; I don't know yet how to trigger and pass parameter to this script or redirect info to a file (that I then send by email). Thanks.
A cheesy way to do that is to use a popen ("tail -f /var/log/auth.log", "r") and then read that. It will give you every login regardless of ssh, telnet etc. You could then generate the emails from that. I have no idea just how resource intensive this might be. You would also have to ensure it got started by rc during boot.
More information about the freebsd-questions
mailing list