Table of Contents
Repeated failed SSH logins can indicate password guessing, especially on an internet-facing server. A failed attempt does not establish a breach. Review any unfamiliar successful sign-in first, then restrict who can reach SSH and replace password-only sign-in where practical.

Check OpenSSH authentication logs
On a server you administer, query the journal for the service name your distribution uses. Ubuntu commonly uses ssh, while other distributions may call it sshd. Systems that use file-based logging may record the same activity in an authentication log.
sudo journalctl -u ssh --since "24 hours ago"
sudo journalctl -u sshd --since "24 hours ago"Use the command for the service that exists. Compare failure timestamps and source addresses with Accepted entries. A burst from one address can be a scanner, while a cluster tied to a scheduled job can be a misconfigured client. Check which accounts, keys, and source networks you expect before deciding which sign-ins need investigation. See the Ubuntu OpenSSH guide.
Reduce exposure and require stronger sign-in
- Limit network access to approved sources through a firewall, VPN, or jump host where possible. On Linux, use ss to identify listening sockets.
- Set up SSH keys and test a separate login before disabling password authentication. Check keyboard-interactive authentication as well, since it may still prompt for a password through PAM or be part of a planned MFA flow.
- Restrict direct root login where practical and allow only named administrative users or groups. Keep a console or another known-good access path during changes.
- Review
MaxAuthTriesfor attempts per connection and controls such asMaxStartupsfor concurrent unauthenticated connections. A tool such as Fail2Ban can act on repeated failures. Allow for shared addresses and verify that the policy will not block your administrators.
Check the effective OpenSSH configuration and run sudo sshd -t before applying a change. Keep an existing session open until a fresh login succeeds. Exact directives and defaults vary with version and distribution, so consult the installed manual and the OpenSSH reference. Changing ports may reduce log noise, but access restrictions and authentication are the controls that matter.
If a suspicious login succeeded
Record the source, account, and time. Preserve logs and follow your incident response process to isolate the server and review credentials from a clean device. Blocking one address does not account for actions taken during an earlier session.
Reader Comments 0
Sign in with email or Google to join the discussion.