summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsbin/itzks-update-disklserver-squashfs-images11
1 files changed, 11 insertions, 0 deletions
diff --git a/sbin/itzks-update-disklserver-squashfs-images b/sbin/itzks-update-disklserver-squashfs-images
index 966484b..b0438a1 100755
--- a/sbin/itzks-update-disklserver-squashfs-images
+++ b/sbin/itzks-update-disklserver-squashfs-images
@@ -138,6 +138,17 @@ for chroot in ${ltsp_chroots}; do
done
+ # Copy an appropriate SSH known_hosts key file DLWs to ${LTSP_OPT}/${chroot}/root/.ssh/known_hosts.
+ # Currently we prefer disklserver:/root/.ssh/known_hosts.DLW and fall back to the host's known_hosts file
+ # (i.e. disklserver:/root/.ssh/known_hosts).
+ if [ -e "/root/.ssh/known_hosts.DLW" ] && [ ! -e "${LTSP_OPT}/${chroot}/root/.ssh/known_hosts" ]; then
+ mkdir -p "${LTSP_OPT}/${chroot}/root/.ssh/"
+ cp "/root/.ssh/known_hosts.DLW" "${LTSP_OPT}/${chroot}/root/.ssh/"
+ elif [ -e "/root/.ssh/known_hosts" ] && [ ! -e "${LTSP_OPT}/${chroot}/root/.ssh/known_hosts" ]; then
+ mkdir -p "${LTSP_OPT}/${chroot}/root/.ssh/"
+ cp "/root/.ssh/known_hosts" "${LTSP_OPT}/${chroot}/root/.ssh/"
+ fi
+
# Copy the host's SSH host keys to the LTSP client chroot if it doesn't have any host keys
host_keys="$(find /etc/ssh/ssh_host_*)"
if [ -n "${host_keys}" ]; then