diff --git a/spread/google.go b/spread/google.go index d1b08a5b..0e56f2a5 100644 --- a/spread/google.go +++ b/spread/google.go @@ -154,6 +154,9 @@ const googleStartupScript = ` echo root:%s | chpasswd sed -i 's/^\s*#\?\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/' /etc/ssh/sshd_config +sed -i 's/^PermitRootLogin=/#PermitRootLogin=/g' /etc/ssh/sshd_config.d/* || true +sed -i 's/^PasswordAuthentication=/#PasswordAuthentication=/g' /etc/ssh/sshd_config.d/* || true +test -d /etc/ssh/sshd_config.d && echo -e 'PermitRootLogin=yes\nPasswordAuthentication=yes' > /etc/ssh/sshd_config.d/00-spread.conf pkill -o -HUP sshd || true