SSH (OpenSSH) 10 · Server (sshd)

Disable password logins

Allow keys only and block root logins. Confirm key login works first, in a second session.

PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes

Caution: If key login isn't working, this setting locks you out. Keep a second session open while testing.

Official SSH (OpenSSH) 10 documentation

More server (sshd) commands

All server (sshd) commands · SSH (OpenSSH) 10 cheatsheet

Was this page helpful?