linux how to change password

Answer

If you want to change password of user that are currently logged in, just type:

passwd

Input old password, then type new password 2 times.

Did you run the passwd command as root? There is a difference between whether you change the password as an root or as a standard user. While the root is called upon to enter a password, the password policy more fully. But if he fails, the password is changed, even though the system grumble. Current user must comply with password policy.

Let's assume, that you are user bob. If you would like to change bob's password, log as bob and type:

passwd

If you are root, and if you want to change bob's password, type:

passwd bob

Please, always try to check, if you set good new password. There is a possibility, that you misspell password, so try to log in to second console (or putty session) immediately after login.

You can also set following options:

Option Property
-d Delete password for an account. It will set passwordless account.
-e Expire. The user will be forced to change password in the next login.
-n Minimum password lifetime.
-x Maximum password lifetime.

Was this information helpful to you? You have the power to keep it alive.
Each donated € will be spent on running and expanding this page about UNIX Shell.