Skip to content
BENIBIX Learn

SSH Password Authentication

Infrastructure🔑 SSH & Remote AccessSSH Login Security

Also known as PasswordAuthentication, SSH Password Login, Disable Password Login

Logging in to SSH with a password. Safer servers turn it off and use keys.

Think of it like

Think of it like a door that opens to anyone who says the right word. Someone will keep guessing words.

Example

Lucy's new server logs thousands of failed password guesses in its first day. She turns password login off, and the guesses stop working.

Why it matters

Guessing passwords is the most common attack on a new server. Turning them off ends it.

Definition

Password authentication is logging in to SSH by typing a password. It is easy, but bots try common passwords on every server, all day long. A password can be guessed, reused or stolen. Most guides say to turn it off once your key works. You do that with PasswordAuthentication no in sshd_config.

Example code

console
$ ssh -o PubkeyAuthentication=no lucy@203.0.113.10
lucy@203.0.113.10: Permission denied (publickey).
With passwords turned off, a login without a key is refused at once.
The bots on the left are guessing passwords. With password login off, none of their guesses can work.

Common mistake

Turning it off before your key login works. Then nobody, including you, can get in.

Key takeaways

  1. 1
    Easy to guess. Bots try all day.
  2. 2
    Keys instead. Turn passwords off once keys work.
  3. 3
    One line. PasswordAuthentication no.

Compare

Learn it properly