Created
September 24, 2014 11:27
-
-
Save zanloy/477a802a600bfe114f3c to your computer and use it in GitHub Desktop.
Regenerate SSH host keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Tested in RedHat but should work in other distros. | |
#set -x | |
rm -f /etc/ssh/ssh_host_key | |
rm -f /etc/ssh/ssh_host_key.pub | |
rm -f /etc/ssh/ssh_host_rsa_key | |
rm -f /etc/ssh/ssh_host_rsa_key.pub | |
rm -f /etc/ssh/ssh_host_dsa_key | |
rm -f /etc/ssh/ssh_host_dsa_key.pub | |
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