In this quick tutorial we will learn how to change Linux user password using command line. First we need to connect to the server using ssh.

For SSH access one can use either build-in Linux, iOS and Windows terminal or standalone terminal like Putty client [download]. We are using Ubuntu Linux, so we will use build-in terminal.

Connecting to server via SSH
ssh [email protected] or IP address

In order to change a user password you can use the command below:

passwd USER

Change USER for the actual username you are updating the password for. In our case, we will update password for the user ubuntu. Please, keep in mind the password strength and do not use weak password.

command for changing linux user password
Linux change user password command

You will be required to enter current password first, then new password and new password confirmation to make sure you entered the desired password.

Once password has been updated, you will see message: password updated successfully

Comments to: How to change Linux user password using Linux command

Your email address will not be published. Required fields are marked *