Report last login failures
I am trying to configure a RHEL4 system running with KDE so that it displays failed login attempts to the user after login.
What I tried so far:
I added the pam_tally entry so that failed login attemps are logged to /var/log/faillog.
I also created a faillog file which has rw-access for the root user, but no access to other users.
Using faillog -u <user> I can see the last login failure.
But what I would like to do is this:
Optimum would be a graphical display during the login to KDE.
In the kdm.conf I already modified the entry so that the last successful login will be shown in the graphical login manager after typing in the user name, before typing the password.
It would be fine, if the last failed login would also be reported here, if possible.
But it would also be okay, if after the successful login a message dialog (e.g. using kdialog) would show up, informing about the last login failures.
I already tried several ways to get there, but my major problem is, that the information in the faillog is reset once the user logs in successfully. So I thought I might have to store it somewhere during the login, before the reset is taking place. But I couldn't figure out, how to do that. Especially since the user doesn't even have the rights to access the faillog command.
I have not been working with Linux that much before, so I don't know, if there is a simple way to solve my problem.
Can anybody help me?