From b54d24ff3310f7ace00ab08e0dacfdc89e026f1c Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 28 Jun 2022 13:24:46 +0200 Subject: [PATCH] fix: don't modify ssh_config for ubuntu-cpc projects (LP:1968873) Modifying directly /etc/ssh/sshd_config creates "problems" when upgrading eg. from Focal to Jammy because the upgrade will ask the user what to do with the modified config. To avoid that, put the custom configuration into /etc/ssh/sshd_config.d/ so the upgrade of openssh-server can just replace /etc/ssh/sshd_config without asking the user. --- .../ubuntu-cpc/hooks.d/chroot/052-ssh_authentication.chroot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/052-ssh_authentication.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/052-ssh_authentication.chroot index 6b0a34ea..0218a85f 100755 --- a/live-build/ubuntu-cpc/hooks.d/chroot/052-ssh_authentication.chroot +++ b/live-build/ubuntu-cpc/hooks.d/chroot/052-ssh_authentication.chroot @@ -1,3 +1,5 @@ #!/bin/bash -sed -i "s|#PasswordAuthentication yes|PasswordAuthentication no|g" /etc/ssh/sshd_config +cat << EOF >> "/etc/ssh/sshd_config.d/10-cloudimg-settings.conf" +PasswordAuthentication no +EOF