Trapping user logins in python =?iso-8859-6?q?=09?=( post #1)

Patrick Rutkowski rutski89 at gmail.com
Mon Jul 4 17:43:35 EDT 2005


On Monday 04 July 2005 13:49, Jeff Epler wrote:
> I don't know of a portable way for an inetd-style daemon to "listen" for
> user logins.
>
> On some systems (including RedHat/Fedora and debian), you may be able to
> use PAM to do this.  (pam modules don't just perform authentication,
> they can take other actions.  As an example, pam_lastlog "prints the
> last login on successful login".  I'm not sure what priviledge a pam
> module has when it executes.
>
> A more standard way to do this would be to place lines in /etc/profile
> /etc/csh.login and so forth for any other shells used on your system.
> RedHat-style systems have an /etc/profile.d where you can drop a file
> that will be executed at login, too.  This will, of course, be executed
> with the user's privilege level.  Another problem with this approach is
> that /etc/profile is executed for a "login shell", but a graphical login
> is not a login shell.
>
> Jeff

If you'd like to hack and slash your way to a solution then you could run 
"watch who" in a daemon that then sed's the output to your desired format and 
then dumps it to a log/notification.



More information about the Python-list mailing list