4
# Regenerate the ssh host key
7
rm -f /etc/ssh/ssh_host_*_key*
9
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' | logger -s -t "ec2"
10
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' | logger -s -t "ec2"
12
# This allows user to get host keys securely through console log
13
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" | logger -s -t "ec2"
14
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub | logger -s -t "ec2"
15
ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub | logger -s -t "ec2"
16
echo "-----END SSH HOST KEY FINGERPRINTS-----" | logger -s -t "ec2"