Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 down vote accepted

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

AUTOCREATE_SERVER_KEYS=NO

or

AUTOCREATE_SERVER_KEYS=RSAONLY

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
add comment

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.