Sometimes the issue is in fact keeping track of failed SSH logins.
Sometimes the issue is something else altogether, and a failed SSH login is merely a symptom of the real problem. It does depend on where you sit and where you're looking, because solutions will be very different. This is why it's good form to describe the problem in more detail than what OP did.
If you're a server admin who wants to keep track of failed attempts to log into the server, then you gotta know how to set that up and how it's supposed to work.
Going by what
ShelLuser said, and making some logical assumptions, I would imagine that a failed SSH login would be logged into
/var/log/sshd/ or something similar. In which case, OP just needs to write a simple Perl or sh script to count the number of failed SSH logins (and maybe sort by IP address, while we're at it?). Just run
cat /var/log/sshd/messages | grep "failed login" | wc -l
or something similar. There's your counter for failed SSH logins. Of course, that was just a suggestion based on some speculation of what the situation might be.
But if you're a regular user who experienced a failure trying to SSH into a remote machine: Some server admins do keep track of failed logins and will set things up to give you an error message that says something like "Too many authentication attempts, please try again later", which merely means wait 30 minutes, and pay attention to typing in your username and password correctly. Another avenue available to you is to delete the
~/.ssh/ directory and try again - in which case the remote SSH server will not recognize you, and you'll have to set up the SSH keys all over again.
Also: "
Installation and Maintenance of Ports and Packages" is probably not the best place to ask for help with using SSH... "
Web and Network Services" would be more appropriate.