From 81f375f6da162e13354e8925a61d144b120c9ba3 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 9 Nov 2026 20:26:06 +0100 Subject: [PATCH 1/3] Include sshd-session in the el9 diskless initramfs EL 9.8 ships OpenSSH 9.9, whose sshd runs each connection through /usr/libexec/openssh/sshd-session. Without it the initramfs sshd refuses to start, so debugssh does not work on EL 9.8 images. Install it when present, older EL9 releases do not have it. --- imgutil/el9/dracut/install | 1 + 1 file changed, 1 insertion(+) diff --git a/imgutil/el9/dracut/install b/imgutil/el9/dracut/install index d935f2a7..7c339109 100644 --- a/imgutil/el9/dracut/install +++ b/imgutil/el9/dracut/install @@ -8,6 +8,7 @@ dracut_install -o unsquashfs # optional, imageboot extracts with cp when absent dracut_install modprobe touch echo cut wc bash uniq grep ip hostname dracut_install awk egrep dirname expr sort dracut_install ssh sshd reboot parted mkfs mkfs.ext4 mkfs.xfs xfs_db mkswap +dracut_install -o /usr/libexec/openssh/sshd-session # OpenSSH 9.8 and later, EL 9.8 has 9.9 dracut_install efibootmgr uuidgen dracut_install du df ssh-keygen scp dhclient dracut_install /lib64/libnss_dns* From e23873888fe481c78cc96f3fd41dd2bdbdb2f9f0 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 9 Nov 2026 20:26:06 +0100 Subject: [PATCH 2/3] Serve installtodisk syncfiles with the sshd of the image After image2disk, installimage stopped the sshd of the image and moved port 22 to the initramfs sshd, chrooted into the install target, by sending that sshd HUP. The el9 initramfs only starts its sshd with debugssh, and on EL 9.8 it cannot start at all without sshd-session, so normally nothing listened on port 22. The syncfiles push of post.sh then failed with connection refused while the node still reported completed. Restart the sshd of the image instead, chrooted into the install target. It is always present and matches the OpenSSH helpers of the image, so this also works for images packed or captured before the initramfs fix. Wait for the old sshd to exit first, so the new one can bind port 22. --- .../profiles/default/scripts/installimage | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage index bec197a3..ae3f1e13 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage @@ -25,8 +25,6 @@ else done fi cd /sysroot/run -[ -f /run/sshd.pid ] && -cp /run/sshd.pid /tmp/dbgssh.pid chmod 0600 /sysroot/etc/ssh/ssh*key chroot /sysroot/ bash -c "/usr/sbin/sshd" chroot /sysroot/ bash -c "source /etc/confluent/functions; run_remote_python getinstalldisk" @@ -49,11 +47,14 @@ if [ -f /sysroot/etc/lvm/devices/system.devices ]; then fi chroot /sysroot /usr/lib/systemd/systemd-udevd --daemon chroot /sysroot bash -c "source /etc/confluent/functions; run_remote_python image2disk.py" -echo "Port 22" >> /etc/ssh/sshd_config -echo 'Match LocalPort 22' >> /etc/ssh/sshd_config -echo ' ChrootDirectory /sysroot/run/imginst/targ' >> /etc/ssh/sshd_config -kill $(cat /sysroot/var/run/sshd.pid) -[ -f /tmp/dbgssh.pid ] && kill -HUP $(cat /tmp/dbgssh.pid) +sshdpid=$(cat /sysroot/var/run/sshd.pid) +kill $sshdpid +# wait for the old sshd to release port 22 +for i in {1..50}; do kill -0 $sshdpid 2> /dev/null || break; sleep 0.1; done +# Serve the install target on port 22 for the syncfiles push of post.sh. Use +# the sshd of the image: the initramfs sshd only runs with debugssh and may +# lack helpers of the image's OpenSSH version, like sshd-session +chroot /sysroot /usr/sbin/sshd -p 22 -o ChrootDirectory=/run/imginst/targ cp /sysroot/etc/pki/ca-trust/source/anchors/* /sysroot/run/imginst/targ/etc/pki/ca-trust/source/anchors/ chroot /sysroot/run/imginst/targ update-ca-trust From 9b84a4ecba3b657c3bd3784537cb10fb9b757041 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 9 Nov 2026 21:03:07 +0100 Subject: [PATCH 3/3] Point the installtodisk no disk hint at port 22 While installimage waits for an install disk, the sshd of the image listens on port 22. The el9 initramfs sshd on port 2222 only runs with debugssh. --- .../el9-diskless/profiles/default/scripts/installimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage index ae3f1e13..8ce648b1 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage @@ -34,7 +34,7 @@ for nameserver in $(sed -n '/^nameservers:/,/^[^-]/p' /etc/confluent/confluent.d done if [ ! -f /sysroot/tmp/installdisk ]; then - echo 'Unable to find a suitable installation target device, ssh to port 2222 to investigate' + echo 'Unable to find a suitable installation target device, ssh to port 22, or 2222 with debugssh, to investigate' while [ ! -f /sysroot/tmp/installdisk ]; do sleep 1 done