SSH Weak Authentication Configuration
Weak SSH authentication configuration does not require exploiting a CVE. It means the server is configured in a way that makes credential attacks easier, allows access vectors that should be disabled, or accepts keys without passphrase protection. These are misconfigurations with direct exploitation paths.
Check Authentication Methods Permitted
Connect and observe what the server offers before authentication completes:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
password in this list means password authentication is enabled. keyboard-interactive is often a wrapper for password auth. publickey alone is the most secure configuration.
Run the dedicated NSE script for a structured view:
PermitRootLogin
Direct root login over SSH means any successful credential attack immediately yields full system access. The safest setting is prohibit-password or no. yes or without-password with a weak or exposed key is critical.
Test directly:
If the server presents a password prompt for root rather than immediately rejecting the connection, PermitRootLogin yes is likely active. A Permission denied (publickey) response means root login is restricted to key authentication only.
If you have read access to the sshd config after gaining a shell:
PasswordAuthentication Enabled
Password authentication enabled on an internet-facing SSH service is a brute-force target. Combined with no account lockout policy it allows unlimited attempts.
Confirm it is enabled:
A password prompt confirms password authentication is accepted. A Permission denied (publickey) rejection means password auth is disabled server-side.
When password auth is confirmed, credential attacks are viable. See SSH Password Credential Attacks.
Empty Passphrase Private Keys
Private keys without a passphrase provide no additional protection beyond file access. If a key file is world-readable or accessible to a compromised user, it can be used immediately without any cracking.
Check for key files accessible on the current host and whether they have passphrases:
Test whether a key has a passphrase:
If the command outputs the public key without prompting for a passphrase, the key has no passphrase protection. A passphrase-protected key prompts before outputting.
Empty passphrase keys that are also listed in an authorized_keys file on another host create a direct lateral movement path. See SSH Lateral Movement with Harvested Keys.
MaxAuthTries and Failed Login Visibility
A MaxAuthTries value of 6 or higher combined with password authentication allows cycling through multiple passwords per connection before being disconnected. The default is 6.
Check from the verbose connection output:
Or read from the config if you have shell access:
AllowUsers and DenyUsers Absence
Without AllowUsers or DenyUsers restrictions, every system account with a valid shell can attempt SSH login. Service accounts, legacy users, and default accounts all become part of the attack surface.
No output means no account restrictions are configured and all valid accounts are loginable over SSH.
References
-
ssh-auth-methods NSE Scriptnmap.org/nsedoc/scripts/ssh-auth-methods.html (opens in new tab)
Enumerates authentication methods accepted by an SSH server for a given username
-
sshd_config(5) — OpenBSD manual pageman.openbsd.org/sshd_config.5 (opens in new tab)
Full reference for all sshd configuration directives including authentication settings
Was this helpful?
Your feedback helps improve this page.