Generate SSH host public key from the private key.

This commit is contained in:
Russell O'Connor 2014-12-29 18:08:57 -05:00
parent d1cbbff1e3
commit 3251948029
1 changed files with 1 additions and 7 deletions

View File

@ -158,13 +158,7 @@ in
mv -f /root/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key
echo "downloaded ssh_host_ecdsa_key"
chmod 600 /etc/ssh/ssh_host_ecdsa_key
fi
echo "obtaining SSH public host key..."
${wget} -O /root/ssh_host_ecdsa_key.pub http://metadata/0.1/meta-data/attributes/ssh_host_ecdsa_key_pub
if [ $? -eq 0 -a -e /root/ssh_host_ecdsa_key.pub ]; then
mv -f /root/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub
echo "downloaded ssh_host_ecdsa_key.pub"
${config.programs.ssh.package}/bin/ssh-keygen -y -f /etc/ssh/ssh_host_ecdsa_key > /etc/ssh/ssh_host_ecdsa_key.pub
chmod 644 /etc/ssh/ssh_host_ecdsa_key.pub
fi
'';