We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f34ee5e commit 2ab30c5Copy full SHA for 2ab30c5
1 file changed
ebssurrogate/scripts/qemu-bootstrap-nix.sh
@@ -160,6 +160,15 @@ function clean_system {
160
# remove passwords in user-data-cloudimg.img (required for Packer login)
161
usermod -p '*' ubuntu
162
usermod -p '*' root
163
+
164
+ # Ensure that PasswordAuthentication is off
165
+ # From chroot-boostrap-nix.sh
166
+ sed -i -E \
167
+ -e 's/^#?\s*PasswordAuthentication\s+(yes|no)\s*$/PasswordAuthentication no/g' \
168
+ -e 's/^#?\s*ChallengeResponseAuthentication\s+(yes|no)\s*$/ChallengeResponseAuthentication no/g' \
169
+ /etc/ssh/sshd_config
170
+ grep -qE "^PasswordAuthentication\s+no" /etc/ssh/sshd_config \
171
+ || { echo "ERROR: PasswordAuthentication is not disabled in sshd_config"; exit 1; }
172
}
173
174
install_nix
0 commit comments