Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
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
up vote 9 down vote accepted

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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