Not able to set password in ArchLinux

passworduseradd

I logged in as root and created a new account:

# useradd -d /home/onie -m onie
# su onie

Now I try to set the password for onie myself using the passwd command, but it's asking for my current password when I don't have one!

Best Answer

If you don't specify a password when running useradd (-p PASSWORD), it disables the password on that account; the only way to login to it is through some other authentication method (e.g. SSH keys), or by suing from root. Since passwords are disabled, you can't set a new one as a regular user. Root can change anyone's password without needing the current password though, so run:

[root@myhost ~]# passwd onie