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!

2
  • It seems that only root can change the password for the new user. Commented Jun 16, 2011 at 7:34
  • You might want to use the interactive option, adduser Commented Jun 16, 2011 at 7:42

1 Answer 1

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.