# Fix hostname in keys
kvmx_sudo_run sed -i -e "s/root@.*$/root@$hostname.$domain/" $WORK/etc/ssh/*.pub
+ # SSH dir
+ sshdir="`dirname $image`/ssh/"
+ mkdir -p $sshdir
+
+ # Save host SSH key fingerprints
+ for key in $WORK/etc/ssh/*pub; do
+ ssh-keygen -l -f $key >> `basename $key`.sha256
+ ssh-keygen -l -E md5 -f $key >> `basename $key`.md5
+ done
+
# Sudo
echo "Installing sudo..."
$APT_INSTALL sudo -y
if [ "$ssh_support" == "y" ]; then
if [ "$ssh_custom" == "y" ]; then
- privkey="`dirname $image`/ssh/$hostname.key"
+ privkey="$sshdir/ssh/$hostname.key"
pubkey="${privkey}.pub"
- mkdir -p "`dirname $privkey`"
__kvmx_ssh_keygen $privkey "$user@$hostname"
else
pubkey="$DIRNAME/share/ssh/insecure_private_key.pub"