aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/build/linux.go7
-rwxr-xr-xpkg/build/linux_gen.sh2
-rw-r--r--pkg/build/linux_generated.go14
3 files changed, 9 insertions, 14 deletions
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index c35e5795e..f08455c39 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -122,13 +122,6 @@ func (linux) createImage(params *Params, kernelPath string) error {
if err := osutil.CopyFile(filepath.Join(tempDir, "disk.raw"), imageFile); err != nil {
return err
}
- keyFile := filepath.Join(params.OutputDir, "key")
- if err := osutil.CopyFile(filepath.Join(tempDir, "key"), keyFile); err != nil {
- return err
- }
- if err := os.Chmod(keyFile, 0600); err != nil {
- return err
- }
return nil
}
diff --git a/pkg/build/linux_gen.sh b/pkg/build/linux_gen.sh
index d69e61bc7..c4de59ce0 100755
--- a/pkg/build/linux_gen.sh
+++ b/pkg/build/linux_gen.sh
@@ -7,5 +7,5 @@ set -eu
echo -en '// Code generated by pkg/build/linux.go. DO NOT EDIT.\n\n' > linux_generated.go
echo -en 'package build\n\n' >> linux_generated.go
echo -en 'const createImageScript = `#!/bin/bash\n' >> linux_generated.go
-cat ../../tools/create-gce-image.sh | grep -v '#' >> linux_generated.go
+cat ../../tools/create-gce-image.sh | egrep -v '^\s*#' >> linux_generated.go
echo -en '`\n\n' >> 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