SSH User Enumeration
OpenSSH versions before 7.7 respond differently to public key authentication attempts for valid versus invalid usernames. Valid usernames trigger a longer processing time because the server checks the key against stored authorized keys. Invalid usernames fail immediately. This timing difference confirms whether an account exists without completing authentication.
First confirm the version is in the vulnerable range. See SSH Version-Based Vulnerability Check.
Vulnerable range: OpenSSH < 7.7
Enumerate Users with ssh-user-enum
ssh-user-enum automates the timing-based check against a username list:
[+] root -- found! [+] admin -- found! [-] test -- not found [-] oracle -- not found [+] www-data -- found!
found! means the account exists on the system. The output is a confirmed list of valid usernames to use for password or key attacks.
Nmap Script
The ssh-brute script also leaks valid usernames via timing on vulnerable versions during the user validation phase even when no password matches.
Manual Timing Check
For a single username test without tools:
A valid username takes measurably longer to reject because the server processes the key lookup. An invalid username fails immediately. The difference is typically 200ms to several seconds depending on authorised keys configuration. Manual timing is unreliable on high-latency connections — use ssh-user-enum for consistent results.
What Valid Usernames Enable
A confirmed username list feeds directly into password attacks and key-based authentication testing. Priority usernames to test immediately:
root— direct root access if password auth is enabledService accounts (
www-data,git,postgres) — often have weaker passwords or accessible key filesAny username matching application or database accounts discovered elsewhere in the target
Take confirmed usernames into SSH Password Credential Attacks.
References
-
ssh-brute NSE Scriptgithub.com/nmap/nmap/blob/master/scripts/ssh-brute.nse (opens in new tab)
Nmap script source for SSH brute force and user validation
-
CVE-2018-15919nvd.nist.gov/vuln/detail/CVE-2018-15919 (opens in new tab)
NVD entry for the OpenSSH timing-based username enumeration vulnerability
Was this helpful?
Your feedback helps improve this page.