In imageupgrade_functions, restart sshd after config + preserve hostname after restart.

This commit is contained in:
Thomas Stokes
2024-03-25 22:56:10 +01:00
parent efaf7489ab
commit 02265610a3
@@ -160,6 +160,7 @@ finalize() {
setup_cloud_cfg_and_root_login() {
sed -i 's/#PermitRootLogin yes/PermitRootLogin without-password\nPermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/^disable_root: true$/disable_root: false/' /etc/cloud/cloud.cfg
echo "preserve_hostname: true" >> /etc/cloud/cloud.cfg
}
setup_fail2ban() {
@@ -222,4 +223,5 @@ setup_sshd_resilience() {
echo "ClientAliveInterval 3
ClientAliveCountMax 3
GatewayPorts yes" >> /etc/ssh/sshd_config
systemctl reload sshd.service
}