Question

How to record failed ssh password login attempts?

Not sure exactly how to word the question and therefore cannot find anything about it on Google, but is there a way (in Ubuntu 12.04 - 14.10) to record any failed login attempts that occur over ssh? I’m aware that these sorts of logs are made as my droplet gets attacked every few seconds when fail2ban isn’t enabled, but is there a way of seeing what sort of passwords are being guessed? For example, if my password is abc123, I’ll want to change it as soon as possible if they’re guessing abc122 but can relax a little if !@!@!@! is what’s being guessed. Please let me know if you know how to do this sort of thing, as I’m really curious as to what the bots are trying. For all I know, they could be very close to guessing what I view as a very secure password.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

With a standard installation of openssh-server this is not possible and would not generally be recommended as any solution would likely log successful passwords as well and if that could be avoided it would still log legitimate failed attempts (if you were to mix up two characters of your password). That being said I was able to locate a discussion on just this topic on the Ubuntu forums that includes a link to a patch for the ssh server which should make this possible.

For security reasons sshd does not log the password being used. This is to prevent your legitimate password from being logged if you missed a case, or added a space.