1

I have a board (Pine64) on which I run my custom-built linux distribution (using buildroot).

I configure root to have no password, and the resulting /etc/shadow file looks like this:

root::::::::
daemon:*:::::::
bin:*:::::::
sys:*:::::::
sync:*:::::::
mail:*:::::::
www-data:*:::::::
operator:*:::::::
nobody:*:::::::
avahi:*:::::::
dbus:*:::::::
mosquitto:*:::::::
sshd:*:::::::

My /etc/passwd looks like this:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/false
bin:x:2:2:bin:/bin:/bin/false
sys:x:3:3:sys:/dev:/bin/false
sync:x:4:100:sync:/bin:/bin/sync
mail:x:8:8:mail:/var/spool/mail:/bin/false
www-data:x:33:33:www-data:/var/www:/bin/false
operator:x:37:37:Operator:/var:/bin/false
nobody:x:65534:65534:nobody:/home:/bin/false
avahi:x:1000:1000::/:/bin/false
dbus:x:1001:1001:DBus messagebus user:/var/run/dbus:/bin/false
mosquitto:x:1002:65534:Mosquitto user:/:/bin/false
sshd:x:1003:1002:SSH drop priv user:/var/empty:/bin/false

So as you can see there is no password set for root.

Yet when I try to login after boot, I am prompted for password, which I can't supply (because I didn't set one). Any value that I try yields an incorrect password message.

IMPORTANT: I'm booting my system with nfsroot so the root filesystem is mounted from an NFS share on my machine.

The owner of both passwd and shadow in my nfs folder is root, and only root is allowed to write to both.

So do you have any idea why I am still prompted for password even though I shouldn't be?

2

By default, sshd doesn't allow empty passwords (cf. PermitEmptyPasswords and AuthenticationMethods).

There is also UsePAM (which is enabled, by default) which might result in your PAM configuration bailing out on empty passwords.

That said, do you really want to have a wide-open root account?

I mean, you could easily just set up public-key auth for the root user with a password-less private key. In that way you could log in without entering a password, but not everybody with network access could.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.