0

I built a linux kernel (v. 5.17.1) with default config and created a minimal root fs using buildroot (both for x86_64). I modified the configuration of buildroot to use glibc and added DHCP for eth0. Furthermore I added a dropbear ssh server.

I can boot into the system using qemu:

qemu-system-x86_64 -m 1G -kernel linux-5.17.1/arch/x86_64/boot/bzImage -initrd buildroot-2022.02/output/images/rootfs.cpio -net nic -net user,hostfwd=tcp::2222-:22

The logs state that dropbear (sshd) is started successfully, however the server is not running when trying to connect. I can start it manually using /etc/init.d/S50dropbear start, which also states that it was successful. But it seems to quit right after it started. If I run dropbear in the do-not-fork mode in the foreground, everything is working fine, i. e:

dropbear -FBR

Does anyone have an idea why this could be the case?

3
  • did you check for logs somewhere else, like /var/logs?
    – strugee
    Apr 4, 2022 at 21:43
  • Alright, thanks for the hint (still very much new area for me). Problem was /dev/null was created as a regular file for some reason. Had to fix that using mknod /dev/null c 1 3
    – milck
    Apr 5, 2022 at 6:45
  • 1
    Please turn that into an answer of your own question and accept it for future readers.
    – Philippos
    Apr 5, 2022 at 7:20

1 Answer 1

2

After checking /var/log/messages I noticed dropbear reporting an error: Early exit: Failed to daemonize: No such device

The issue was that /dev/null was created as a regular file, thus I had to delete it and create it properly:

rm /dev/null
mknod /dev/null c 1 3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .