To change unix password from command line: i used :

To change the root password:

sudo passwd

This gave instructions to change the UNIX password. It did not change my user password, who is the only user on the computer.

So which password was changed? Im new and im lost. Thanks

  • you changed the root password, root user is not you. you have to put your user name – ravery Oct 21 '17 at 22:04
  • they best way to understand what you did is to enter the commands whoami (which will respond with your username), then sudo whoami which should let you understand what password you changed. – guiverc Oct 22 '17 at 1:48

You changed the root passwd. Using the sudo command elevated your privileges to root and then executed the passwd command on itself.

To change the password of a user, run:

sudo passwd userid

Where userid is the login of the account you want to update.

You probably want to re-lock the root password as well. By default the root password is locked for security reasons. Lock the root command with:

sudo passwd --lock root

More information on the passwd command can be viewed in its manpage:

man passwd

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