SSH protocol 2 allows you to use DSA, ECDSA, ED25519 and RSA keys when establishing a secure connection to a server. (Keep in mind for this question that I'm only familiar with the procedure and capabilities of RSA, and can't speak for the other methods)
What confuses me, is according to man sshd, Diffie-Hellman is used for the key exchange:
For protocol 2, forward security is provided through a Diffie-Hellman key agreement. This key agreement results in a shared session key. The rest of the session is encrypted using a symmetric cipher...
This leads to two questions:
- Where does the RSA key come into play if it isn't used during the key exchange?
- Why is a second protocol (in this case, Diffie-Hellman) required? Why not just use the client's RSA public key to encrypt the session key on the server, and send it to the client?
host keyto the client public key stored on the server inauthorized_keys? And:it's easier to make the server always have to have a keypair than make the client always have to have a keypair. Withsshthe server never has the private key, butsshchecks the corresponding private key on the client. So the client has the key pair, the server has a copy of the public key. – Timo Dec 14 '22 at 09:30/etc/ssh/and used bysshdto authenticate the server to the client. – cpast Dec 14 '22 at 14:13