Concepts / Passwords and hashes

Passwords and hashes

Key-based authentication

Also called public key authentication, ssh keys, key-only ssh, authorized_keys

Logging in with a private key whose public half the server trusts, instead of a password — so password guessing cannot work.

A signature proves the key; nothing to guess
A signature proves the key; nothing to guess

The private key never leaves the client: it only signs, and the server checks the signature with the public key. With password login off, a guesser has no method to try.

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

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start learning