Skip to content

Instantly share code, notes, and snippets.



Created Sep 24, 2014
What would you like to do?
Regenerate SSH host keys
#Tested in RedHat but should work in other distros.
#set -x
rm -f /etc/ssh/ssh_host_key
rm -f /etc/ssh/
rm -f /etc/ssh/ssh_host_rsa_key
rm -f /etc/ssh/
rm -f /etc/ssh/ssh_host_dsa_key
rm -f /etc/ssh/
ssh-keygen -t rsa1 -N '' -f /etc/ssh/ssh_host_key
ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment