Linux How to Change Password

Linux How to Change Password

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 the password, so try to log in to second console (or putty session) immediately after login.

You can also set the following options:

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

 

Leave a Comment