Display of number of failed logon attempt...at logon
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Display of number of failed logon attempt...at logon
Hi,
Our system is based on RH4 and is using pam_tally and faillog to record failed attempts and to lock users out after 5 attempts.
We have a requirement to provide a normal (non-root) user logging onto our system, with information regarding the number of failed logon attempts made on their account before the current successful logon (similar to the functionality provided by HP Protect Tools on Windows).
My first idea was to add 'faillog -u $USER' to the bashrc, however by the time the bashrc is run - the user has been successfully authenticated and the faillog has been reset back to zero.
I have been googling for several hours and have failed to find any ways to provide this functionality, can anyone suggest some ideas?
I guess sshd's ForceCommand isn't working?
Then only idea i have is to run a crontab script, that will collect and dump this table in some file every x minutes and on-login it will be read with grep for $USER.
I guess sshd's ForceCommand isn't working?
Then only idea i have is to run a crontab script, that will collect and dump this table in some file every x minutes and on-login it will be read with grep for $USER.
This is for local logon, not through ssh.
Yes, the cron option was the only one I had come up with so far.
Okay, that now displays the time that the user last logged in (actually that is handy as well - so thanks for that) but does not detail the number of failed login attempts.
Okay, that now displays the time that the user last logged in (actually that is handy as well - so thanks for that) but does not detail the number of failed login attempts.
I have tried adding LASTLOG_ENAB yes as well but that made no additional difference.
Running man login.defs does not list either the FAILLOG_ENAB nor LASTLOG_ENAB options, so perhaps the version of RH4 we are using does not support these options?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.