Almost every server I run is set up the same way: you cannot log in with a password at all. That surprises people the first time they hear it. Passwords feel like the normal way to prove who you are, and turning them off sounds like leaving the door open. It is the opposite. The servers use SSH keys instead, and once you understand what a key pair actually is, you will see why it is stronger than any password you could type.
Two Halves of One Key
An SSH key is really two files that belong together. The public key goes on the server, in a file attached to your account. The private key stays on your own computer and never travels. The two are mathematically linked: what one half can prove, only the other half can answer. When you connect, the server uses your public key to pose a challenge that only the matching private key can solve. Your computer solves it without ever sending the private key itself across the network.
The comparison I use with people is a padlock and a key. You can hand out copies of the padlock to every server you own — it does not matter who sees it, because a padlock by itself opens nothing. The key that opens it stays in your pocket. A password, by contrast, is a secret you have to hand over, in effect, every time you log in, and anything that passes across a network or sits in a login prompt can be guessed, phished, or brute-forced by a machine trying thousands of combinations a minute.
Why This Beats Passwords in Practice
The first reason is guessing. Automated bots sweep the internet constantly, trying common passwords against any server that will listen. A key is not a word or a phrase a human picked; it is a long string of effectively random data. There is no dictionary for it and no shortcut to guessing it.
The second reason is reuse. People reuse passwords — everybody knows it, and most people still do it somewhere. If one site leaks your password, every account where you used the same one is exposed. A private key is used for one purpose and lives in one place. There is nothing to reuse and nothing for a leaked database to give away.
The third reason is discipline. When password login is switched off entirely, a whole class of attacks simply stops working. It does not matter how weak a password might have been, because the server will not accept one from anybody, including you.
The Honest Trade-Offs
Keys are not magic, and I will not pretend otherwise. If somebody steals your private key file, they have your key — the same as a copied house key. That is why the private key itself can be protected with a passphrase, so the file alone is not enough. It is also why you guard the machine the key lives on.
The other trade-off is convenience at the start. Generating a key pair and installing the public half on a server takes a few minutes of setup that a password does not. And if you lose your only private key with password login disabled, you can lock yourself out and need console access to get back in. The fix for that is simple: keep a backup of the key somewhere safe, the same way you would keep a spare house key.
Where I Land
For anything that faces the internet, keys with password login disabled is the setup I trust, and it is the setup I use. Passwords made sense when logging in meant a person at a keyboard. These days the thing knocking on your server’s door is usually a script, and a script cannot guess its way past a key. A few minutes of setup buys you a door that only opens for the person holding the right key — and that is the whole point of a lock.
