PasswordAuthentication no
Of course you should make really sure to actually have a working public key in your users "~/.ssh/authorized_keys" file and/or in "/root/.ssh/authorized_keys" otherwise you might lock yourself out of the server.But the point here is: given the choice, you should never log in regularily with a ssh password if you can also use a key.
but you are right, key-files on a disk are more vulnerable to theft than secrets in your head. keyfiles with a password ontop are most secure but also most uncomfortable.
Pretty sure that’s not how it works, iirc passwords are stored one-way encrypted. And if it were true, then anyone with root access to a box could comprise every other (Unix) user’s key, which seems like a potentially bigger problem…
Send seed and hashing parameters to the client, then client does hashing, client sends hash, server compares hashes. It's vulnerable to replay attacks, but it's the same with client sending plaintext password to server (assuming that you're not using SSH or similar).
https://en.wikipedia.org/wiki/Zero-knowledge_password_proof
I think SRP is the most widely implemented version. https://en.wikipedia.org/wiki/Secure_Remote_Password_protoco...
* https://en.wikipedia.org/wiki/Password-authenticated_key_agr...
I'm not a SSH guru, so if I'm mistaken please shout at me ;D
* https://en.wikipedia.org/wiki/Password-authenticated_key_agr...
* https://blog.cryptographyengineering.com/2018/10/19/lets-tal...
A Password-Authenticated Key Exchange (PAKE) attempts to address this
issue by constructing a cryptographic key exchange that does not
result in the password, or password-derived data, being transmitted
across an unsecured channel.
* https://datatracker.ietf.org/doc/html/rfc8125I'm sure there are other zero-knowledge protocols besides PAKE-like ones, but I'm not an expert here.
One upside to keys is also that since the server does not have your private key you don't need to rotate it if that server is hacked so you can reuse the same key for multiple servers and services. If you reuse the same long random password it only takes one of those servers/services to be hacked for you to be compromised on all of them.
If you lose a passphrase, no one can help you even if you hit HN front page and /r/all with a sob story. So backups and availability have a different cruciality.
Also if you store a private key on the same medium as a password store with weak encryption or key that contains the passphrase, they key can't be considered as strong anymore.
There are practical reasons to make a distinction and mistakes can be expensive.
Using a password on they key isn't a bad idea either.
At least for KVM based virtual servers that I have this is the case.
In addition to that I have found that using the setting:
AllowUsers "example_account@aaa.bbb.ccc.ddd"
(If you are connecting from a static IP) Will cut down on log spam and connection initializations by a tremendous amount.My servers only have `root` and my own sudo user, (and other default system users). I also run all apps on Docker. I don't think this would be an issue for me.