From owner-freebsd-questions@FreeBSD.ORG Sun Apr 11 07:41:03 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 594D61065677 for ; Sun, 11 Apr 2010 07:41:03 +0000 (UTC) (envelope-from bc979@lafn.org) Received: from zoom.lafn.org (zoom.lafn.ORG [206.117.18.8]) by mx1.freebsd.org (Postfix) with ESMTP id 3BEF28FC13 for ; Sun, 11 Apr 2010 07:41:02 +0000 (UTC) Received: from [10.0.1.4] (pool-71-109-144-133.lsanca.dsl-w.verizon.net [71.109.144.133]) (authenticated bits=0) by zoom.lafn.org (8.14.3/8.14.2) with ESMTP id o3B7f1jt006352 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 11 Apr 2010 00:41:02 -0700 (PDT) (envelope-from bc979@lafn.org) References: <4BC168D8.7080900@webrz.net> In-Reply-To: <4BC168D8.7080900@webrz.net> Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii Message-Id: Content-Transfer-Encoding: quoted-printable From: Doug Hardie Date: Sun, 11 Apr 2010 00:41:01 -0700 To: Jos Chrispijn X-Mailer: Apple Mail (2.1078) X-Virus-Scanned: clamav-milter 0.95.3 at zoom.lafn.org X-Virus-Status: Clean Cc: freebsd-questions@freebsd.org Subject: Re: Auto update X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 07:41:03 -0000 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.=