Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
-rw------- 1 root root    241 Oct  4 22:43 ssh_host_ecdsa_key
-rw-r--r-- 1 root root    194 Oct  4 22:43
-rw------- 1 root root   1602 Oct  4 22:43 ssh_host_rsa_key
-rw-r--r-- 1 root root    378 Oct  4 22:43

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

share|improve this question

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:

share|improve this answer

Your Answer


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.