Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ebssurrogate/scripts/qemu-bootstrap-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@ function clean_system {
rm -rf /root/.vpython*
rm -rf /root/go
rm -rf /mnt/usr/share/doc

# remove passwords in user-data-cloudimg.img (required for Packer login)
usermod -p '*' ubuntu
usermod -p '*' root

# Ensure that PasswordAuthentication is off
# From chroot-boostrap-nix.sh
sed -i -E \
-e 's/^#?\s*PasswordAuthentication\s+(yes|no)\s*$/PasswordAuthentication no/g' \
-e 's/^#?\s*ChallengeResponseAuthentication\s+(yes|no)\s*$/ChallengeResponseAuthentication no/g' \
/etc/ssh/sshd_config
grep -qE "^PasswordAuthentication\s+no" /etc/ssh/sshd_config \
|| { echo "ERROR: PasswordAuthentication is not disabled in sshd_config"; exit 1; }
}

install_nix
Expand Down
Loading