48
44
regenerate_ssh_host_keys() {
49
45
rm -f /etc/ssh/ssh_host_*_key*
51
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' | logger -s -t "ec2"
52
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' | logger -s -t "ec2"
47
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
48
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
54
50
# This allows user to get host keys securely through console log
55
echo | logger -s -t "ec2"
56
echo | logger -s -t "ec2"
57
echo "#############################################################" | logger -s -t "ec2"
58
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" | logger -s -t "ec2"
59
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub | logger -s -t "ec2"
60
ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub | logger -s -t "ec2"
61
echo "-----END SSH HOST KEY FINGERPRINTS-----" | logger -s -t "ec2"
62
echo "#############################################################" | logger -s -t "ec2"
53
echo "#############################################################"
54
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----"
55
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
56
ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
57
echo "-----END SSH HOST KEY FINGERPRINTS-----"
58
echo "#############################################################"
63
if ! ec2-is-compat-env --quiet; then
64
log_daemon_msg "ec2-init disabled"
68
if [ ! -d /var/run/ec2 ]; then
67
72
log_daemon_msg "Waiting for EC2 meta-data service"
68
73
if ec2-wait-for-meta-data-service