Passwords and hashes
Key-based authentication
Logging in with a private key whose public half the server trusts, instead of a password — so password guessing cannot work.
Key-based authentication logs in with a keypair instead of a password. The server keeps the public key in the
account's authorized_keys; the client proves it holds the private key with a signature and never sends the key.
With PasswordAuthentication no, [[credential-stuffing|password guessing]] has nothing to try. The risk moves to the
private key file: anyone who copies it logs in. Give it a passphrase and chmod 600.
Read next
- SSH Encrypted remote login and commands, on TCP port 22, with passwords or keys.
- Online credential guessing Trying username/password pairs against a live service, as fast as it allows — and why it fails against hardened logins.
- Password cracking Recovering a password offline by hashing guesses from a wordlist (optionally mangled by rules) until one matches.
- Leaked private key A private key is a credential in a file: copied out of a backup, a world-readable home or a git repo, it authenticates as the owner on every server that trusts its public half — and because the theft is a silent copy, nothing warns you it happened — so the only fix is to revoke it on the server and rotate to a fresh pair.
- Password spraying Trying one likely password once against every account, so no account passes a lockout threshold and anyone who reused a weak shared secret is found.