Changing user password

Step to step guide to changing user password

Changing the password for the current user is done using the password command, which has the following syntax:

$ passwd
Changing password for user test.
Changing password for test.
(current) UNIX password: [current password is entered]
New password: [enter new password]
Retype new password: [repeat new password]
passwd: all authentication tokens updated successfully.

It is also possible to change the password for another user, for this you need sudo rights (in the example, the command is executed as root user)

Changing password for user test.
New password: [new password is entered]
Retype new password: [new password is repeated
passwd: all authentication tokens updated successfully.