How to change passwords for users on Linux server

Step 1: Switch to the Root Account

Run one of the following commands to become root:

sudo -i

sudo-i

Step 2: Change the Password for a Specific User

Use the passwd command:

passwd username

Examples:

passwd root
passwd administrator

To change your own password:

passwd

change password
The system will ask you to enter the password twice.

Step 3: Re-login to Verify the New Password

Log in to the server again using the newly set password to confirm it works.

Outline