How to change passwords on Linux

You may occasionally need to change a user or root password on your Linux server. This article will guide you through changing your password.

Changing user password as user

To change a password as the user you want to change the password for, just run passwd and press enter. You will be prompted to change your password.

Changing another user's password

To change the password of another user, run the command passwd <username> and press enter. If you're not running as the root user, type in sudo passwd <username> and press enter. You'll then be able to change the password of the user.