Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In my /etc/ssh/ directory, I can see three that I have three different types of ssh keys:

-rw------- 1 root root    607 Oct  4 22:43 ssh_host_dsa_key
-rw-r--r-- 1 root root    623 Oct  4 22:43 ssh_host_dsa_key.pub
-rw------- 1 root root    241 Oct  4 22:43 ssh_host_ecdsa_key
-rw-r--r-- 1 root root    194 Oct  4 22:43 ssh_host_ecdsa_key.pub
-rw------- 1 root root   1602 Oct  4 22:43 ssh_host_rsa_key
-rw-r--r-- 1 root root    378 Oct  4 22:43 ssh_host_rsa_key.pub

What is are the differences between ssh's RSA, DSA, and ECDSA keys, and do I need all three?

share|improve this question

1 Answer 1

They're keys generated using different encryption algorithms. You can choose to use different forms of encryption when using SSH, somewhat similar to the ability to choose different encryption methods for WiFi (WPA2, WPA, WEP, etc).

SSH uses public-key encryption, meaning when you connect to an SSH server it broadcasts a public key which you can use to encrypt further traffic to be sent to that server. If the server is configured to use RSA it will be a key generated by the RSA algorithm.

Your computer sends back its own public RSA key from the key file you listed in your question. The server needs this key to connect back to you and reply.

All three keys exist on your computer because any given SSH server you're connecting to might be configured to use any one of these algorithms. Your computer will send back a unique key matching the type the server uses, your key having been generated on your computer by the same algorithm.

Here's some further resources:

http://security.stackexchange.com/questions/5096/rsa-vs-dsa-for-ssh-authentication-keys

http://en.wikipedia.org/wiki/Public-key_cryptography

http://en.wikipedia.org/wiki/RSA_(algorithm)

http://en.wikipedia.org/wiki/Digital_Signature_Algorithm

http://en.wikipedia.org/wiki/Elliptic_Curve_DSA

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.