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.
This commit is contained in:
Thomas Bechtold 2022-06-28 13:24:46 +02:00
parent a81bea1f0c
commit b54d24ff33

View File

@ -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