A number of articles suggest removing insecure (broken) SSH key types in order to have a more secure server. In practice, if I only connect to the server with secure key types, why should I bother deleting insecure key types? What is a practical attack that can be performed if I do not remove these key types.

From SSH audit:

Disable the DSA and ECDSA host keys

From Secure Secure Shell:

DSA keys must be exactly 1024 bits so let’s disable that. Number 2 here involves NIST suckage and should be disabled as well.

  • The simple answer is: To reduce attack surface, disable everything you aren't actively using. If you aren't planning to use it, disable it. Then you - or someone else - can never accidentally start using it without deliberately re-enabling it. Dec 5, 2022 at 3:00

1 Answer 1


The practical attack from weak ssh hostkeys is man-in-the-middle attacks. It's a bit dated, but it's discussed here

Why should you bother deleting these insecure types? Only you can truly answer that. You don't say how the system is being used or what is your appetite for risk? The steps to harden this part of your system is shown in the links you provided and are trivial.

  1. Regenerate the RSA and ED25519 keys
  2. Remove the small Diffie-Hellman moduli
  3. Disable DSA and ECDSA host keys in sshd_config
  4. Restrict supported key exchange, cipher, and MAC algorithms
  5. Restart the sshd service

ssh.com Host-Key

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .