From 785bbf9f39813fafd09ba10e1d3a6a1f2ff291c2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 Jan 2021 14:31:09 +0100 Subject: tools/create-gce-image.sh: setup ssh with empty password We used to use ssh keys, but there are no partiuclar advantages of using key over empty password. It just makes things more complex. And the new image building code in pkg/build does not support keys. --- pkg/build/linux_generated.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'pkg/build/linux_generated.go') diff --git a/pkg/build/linux_generated.go b/pkg/build/linux_generated.go index fa7256804..7362b634a 100644 --- a/pkg/build/linux_generated.go +++ b/pkg/build/linux_generated.go @@ -98,15 +98,17 @@ fi echo -en "127.0.0.1\tlocalhost\n" | sudo tee disk.mnt/etc/hosts echo "nameserver 8.8.8.8" | sudo tee -a disk.mnt/etc/resolve.conf -echo "ClientAliveInterval 420" | sudo tee -a disk.mnt/etc/ssh/sshd_config echo "syzkaller" | sudo tee disk.mnt/etc/hostname -rm -f key key.pub -ssh-keygen -f key -t rsa -N "" -sudo mkdir -p disk.mnt/root/.ssh -sudo cp key.pub disk.mnt/root/.ssh/authorized_keys -sudo chown root disk.mnt/root/.ssh/authorized_keys sudo mkdir -p disk.mnt/boot/grub +cat << EOF | sudo tee disk.mnt/etc/ssh/sshd_config +PermitRootLogin yes +PasswordAuthentication yes +PermitEmptyPasswords yes +ClientAliveInterval 420 +EOF +sudo sed -i "s#^root:\*:#root::#g" disk.mnt/etc/shadow + CMDLINE="" SYZ_CMDLINE_FILE="${SYZ_CMDLINE_FILE:-}" if [ "$SYZ_CMDLINE_FILE" != "" ]; then -- cgit mrf-deployment