Search For Answers
How do I modify a user password in Linux?
Last updated: March 28, 2011
To set or modify a users password in Linux use the passwd command.
To set the root password you just enter the command with no user declared and hit enter (or return). You will be asked twice for the password. each time you will enter it, then hit enter (or return) and you will not see anything entered as you type (or paste) for security. If you did this correctly ypur output when complete will look like this:

If for the root user you try to use a short insecure password you will get a warning.
To set or modify the password for a specific user you add their account name to the passwd command.
# passwd someuser
And then the process is the same as above.
You will need to be logged in as root to change the root password and to change other users passwords. If you are logged in as a specific user you can change your own password by declaring your username as listed above.