ssh : Why sshd does not start on qemu booting

358 views
Skip to first unread message

Nicholas Zhao

unread,
Apr 17, 2021, 4:00:37 AM4/17/21
to syzkaller
I use the latest qemu and the latest linux.I followed https://github.com/google/syzkaller/blob/master/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md .When I wanna connect to qemu using "ssh -i $IMAGE/stretch.id_rsa -p 10021 -o "StrictHostKeyChecking no" root@localhost" as mentioned in the doc, it failed.And later I found that ssh service just didn't start after qemu booting.I manually use "service sshd start" after qemu booting and I can connect to it later.But how can I set ssh start on qemu booting?I've tried add "service sshd start" into  /etc/rc.local in the stretch.img, however it failed. Is there any other solutions? Thank you .

Palash Oswal

unread,
Apr 17, 2021, 4:02:45 AM4/17/21
to Nicholas Zhao, syzkaller
`systemctl enable sshd` should start it automatically on boot.
You can verify this by running:
```
systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
```

On Sat, Apr 17, 2021 at 1:30 PM Nicholas Zhao <mmmart...@gmail.com> wrote:
>
> I use the latest qemu and the latest linux.I followed https://github.com/google/syzkaller/blob/master/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md .When I wanna connect to qemu using "ssh -i $IMAGE/stretch.id_rsa -p 10021 -o "StrictHostKeyChecking no" root@localhost" as mentioned in the doc, it failed.And later I found that ssh service just didn't start after qemu booting.I manually use "service sshd start" after qemu booting and I can connect to it later.But how can I set ssh start on qemu booting?I've tried add "service sshd start" into /etc/rc.local in the stretch.img, however it failed. Is there any other solutions? Thank you .
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/3181a545-747c-4a32-81be-3ebfa7011b48n%40googlegroups.com.

Nicholas Zhao

unread,
Apr 17, 2021, 4:07:40 AM4/17/21
to syzkaller

How to apply it to the stretch.img? `systemctl enable sshd` can only be used in the qemu.

慕冬亮

unread,
Apr 17, 2021, 4:18:37 AM4/17/21
to Nicholas Zhao, syzkaller
On Sat, Apr 17, 2021 at 4:07 PM Nicholas Zhao <mmmart...@gmail.com> wrote:
>
>
> How to apply it to the stretch.img? `systemctl enable sshd` can only be used in the qemu.

For stretch image generated by tools/create-image.sh, it should enable
sshd by default.

Debian Stretch image requires special kernel configurations to enable
sshd working:

CONFIG_CONFIGFS_FS=y
CONFIG_SECURITYFS=y

See details in https://github.com/google/syzkaller/blob/master/docs/linux/kernel_configs.md
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/aeb8ed7f-193e-49ad-826a-eb65d0e333a8n%40googlegroups.com.

Nicholas Zhao

unread,
Apr 17, 2021, 8:07:18 AM4/17/21
to syzkaller
Well.I just use "./create-image.sh" to generate the stretch.img.But it actually didn't start sshd on booting.

Nicholas Zhao

unread,
Apr 18, 2021, 10:18:14 PM4/18/21
to syzkaller
Anyone else can help me?

慕冬亮

unread,
Apr 18, 2021, 10:30:07 PM4/18/21
to syzkaller
On Sat, Apr 17, 2021 at 8:07 PM Nicholas Zhao <mmmart...@gmail.com> wrote:
>
> Well.I just use "./create-image.sh" to generate the stretch.img.But it actually didn't start sshd on booting.

I just said in the previous email, your kernel configuration requires
the following options to enable sshd working:

CONFIG_CONFIGFS_FS=y
CONFIG_SECURITYFS=y

Have you checked them in your kernel configuration?
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/1e0efccd-4a52-4b73-80ad-9535b6f4483an%40googlegroups.com.

慕冬亮

unread,
Apr 18, 2021, 10:44:13 PM4/18/21
to Nicholas Zhao, syzkaller
On Sat, Apr 17, 2021 at 4:07 PM Nicholas Zhao <mmmart...@gmail.com> wrote:
>
>
> How to apply it to the stretch.img? `systemctl enable sshd` can only be used in the qemu.

when you start qemu, it will finally enter the login menu. With "root"
and empty password, you can login successfully. Then check sshd status
by command "systemctl status sshd".

By the way, that "your ssh connection failed " does not mean sshd does
not work. It can be also due to a network connection issue.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/aeb8ed7f-193e-49ad-826a-eb65d0e333a8n%40googlegroups.com.

Dmitry Vyukov

unread,
Apr 19, 2021, 3:02:23 AM4/19/21
to Nicholas Zhao, syzkaller
On Mon, Apr 19, 2021 at 4:18 AM Nicholas Zhao <mmmart...@gmail.com> wrote:
>
> Anyone else can help me?

If you show boot log, it will be easier to help you ;)
Maybe it's starting, but failing to start?
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/45ee837d-bf2c-43f9-9d89-caebdbaa9been%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages