From ac7d593a6028d724d20b24a6da17e856a7a8a5fe Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 17 Sep 2025 14:13:02 +0200 Subject: sbin/itzks-update-disklserver-squashfs-images: Copy disklserver's /root/.ssh/known_hosts (or known_hosts.DLW into a freshly copied chroot if not already present). Required for SSH access to debian-edu@tjener.intern to obtain krb5.keytab files. --- sbin/itzks-update-disklserver-squashfs-images | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.3