5

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!

  • It seems that only root can change the password for the new user. – John Jun 16 '11 at 7:34
  • You might want to use the interactive option, adduser – jasonwryan Jun 16 '11 at 7:42
9

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

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.