From 480d5b26ea97e0bfebac8aedfa1f2bf7286f027a Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 23 Aug 2022 10:43:50 +0200 Subject: [PATCH] fix: don't modify ssh_config for ubuntu-cpc projects (LP:1968873) The cloud-init bug (see LP:1968873) got fixed now so using a sshd config snippet should work now. This partly reverts commit aa1be5eaaa1fdbb4c31104cc49e54b15f66c3343 but uses now 60-cloudimg-settings.conf instead of 10-cloudimg-settings.conf . --- .../hooks.d/chroot/052-ssh_authentication.chroot | 7 ++++++- 1 file changed, 6 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..4db6efe0 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,8 @@ #!/bin/bash -sed -i "s|#PasswordAuthentication yes|PasswordAuthentication no|g" /etc/ssh/sshd_config +# NOTE: the file number needs to be **higher** than the one +# cloud-init writes (cloud-init uses 50-cloud-init.conf) so +# the cloud-init file takes precedence +cat << EOF >> "/etc/ssh/sshd_config.d/60-cloudimg-settings.conf" +PasswordAuthentication no +EOF