How can I reproduce this message, when we make an SSH connection:

Last failed login: Sun Feb 19 03:52:25 There were 41 failed login attempts since the last successful login.

I want to configure a playbook in Ansible, that will make this check in a group of hosts. Is that possible? Which service is responsible to gerenate this message?

If not, can someone point me a good way out to reach this? I know I can get failed attempts from secure log, but don't know exactly how calculate the number after the last successfull access.


  • CentOS 7 server. – Pedro Henrique Azevedo Apr 17 at 17:25
  • Welcome to U&L! Please, could you elaborate your answer? You can go to the help center for guidance on how to do so. For now, please edit your answer if you have details to add instead of putting them into comments. – Paradox Apr 17 at 17:30
  • @Paradox Elaborate the question, there is a typo there. – Rui F Ribeiro Apr 17 at 18:08
  • @RuiFRibeiro My bad, thanks for the correction. – Paradox Apr 17 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.