On my NetBSD installation, I have it set so that root has no password. I can login as root without typing a password. But, when I create a user with just useradd -m <username>, log out, then enter <username> at the login prompt, I am asked for a password. Why is this? I'd like to login as <username> without a password. Why is this different than root, which logs in right after entering root?

2 Answers 2


Having users without passwords is just a bad idea. Please assign passwords to all your users, especially "root". Every time you create a user without a password, a kitten dies.

On many systems, a good password is often the first, the last and the only line of defense against the scum of the Internet. Please tell me you haven't done that on a machine connected to network...

As far as asking a password, this is because the installation of NetBSD actually allows for password-less root, to be able to debug quickly a botched install. The NetBSD Manual is very specific about this and recommends you to run "passwd" as root immediately after installation.

Take a look at the NetBSD Guide for more details.

  • 1
    That's a great answer…if that had anything to with what I asked. I don't care about the security. It's a test VM. So can you please just tell me how to create a user that I can login to without a password? Many thanks if you do.
    – Melab
    May 13, 2016 at 1:23

You would probably have to look at the source for useradd to find out if it was even possible to specify no password.

The "easy" way to do what you want is to use vipw to edit the password file, possibly to add the user manually, or possibly after having used useradd to do the initial record entry, and all you have to do is delete everything in the password (second) field -- i.e. leave it empty.

See passwd(5) for details (i.e. man 5 passwd).

You must log in to answer this question.

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