Fix "Login attempt with nonexistent user"

As there is no passwd / group file existent in the ramdisk,
loging in the root user isn't possible and it will fail
with the message from above.

This commit fixes the issue by adding the root user / group using
groupadd and useradd tools. I recommend to use these tools,
because they only will add an additional line if the user / group
doesn't exist already.
This commit is contained in:
Felix Singer 2018-12-14 22:54:11 +01:00
parent da78b4c0b4
commit 8d2367a60f

View file

@ -86,6 +86,9 @@ build ()
add_dir "/root/.ssh"
cat /etc/dropbear/root_key > "${BUILDROOT}"/root/.ssh/authorized_keys
groupadd --prefix "${BUILDROOT}" --system -g 0 root
useradd --prefix "${BUILDROOT}" --system -g root -u 0 -M -d /root -s /bin/sh root
add_full_dir "/etc/dropbear"
add_file "/lib/libnss_files.so.2"
add_dir "/var/run"