Server Fault is a question and answer site for system and network administrators. 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

The general idea I've been finding on this is that if you remove the HostKey line which corresponds to a specific key, the key will stop being generated. For whatever reason though, my sshd_config only lists one HostKey at /etc/ssh/ssh_host_rsa_key, and every time I delete the extra keys and restart sshd, it regenerates both the ssh_host_dsa_key and ssh_host_key files. Aside from digging through source and recompiling OpenSSH myself, is there any way to enforce that it not create a specific host key?

Running OpenSSH 6.1p1-4.fc18 on Fedora 18 x86_64 if it makes a difference.

share|improve this question
up vote 2 down vote accepted

You can edit the /etc/sysconfig/sshd file and change the AUTOCREATE_SERVER_KEYS variable:




Also ensure that you only have Protocol 2 in /etc/ssh/sshd_config.

share|improve this answer
Thanks! Good to know there's another file I can configure. – Amazingant Jan 18 '13 at 18:39

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.