21

I have an Ubuntu 14.04 instance running on AWS.

I was browsing the auth logs (/var/log/auth.log*), and noticed the following line appearing:

Could not load host key: /etc/ssh/ssh_host_ed25519_key

This line appears between 1k-10k times a day, presumably due to failed hack attempts.

In researching this problem, I came up with a number of questions.

What is the effect of the absence of this key? I can still log in fine with the key provided by AWS. Is it forcing the security of my SSH connections to be downgraded? Has it been disabled on purpose because of security concerns?

I've seen some people suggest that the key wasn't generated correctly during installation, and that I need to regenerate the key with dpkg-reconfigure or ssh-keygen.

Alternatively, I've also seen people recommend just commenting out the line: HostKey /etc/ssh/ssh_host_ed25519_key in /etc/ssh/sshd_config

38

You can generate the missing hostkey via:

ssh-keygen -A

ed25519 is a bit faster and more secure. It's not necessary and, aside from logspam, this doesn't have that much effect. You could, indeed, comment out HostKey /etc/ssh/ssh_host_ed25519_key, without much effect. But, at the same time, `ed25519 is a good host-key format to support.

  • 1
    After that, I also had to restart the ssh service: sudo service ssh restart – Alan May 24 '17 at 21:19
  • I had empty files for dsa, ecdsa and ed25519 that I had to delete for ssh-keygen -A to do anything – HeatfanJohn May 9 '18 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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