Linux how to change password

To change a user’s password in Linux, you can use the passwd command. Here’s how:

  1. Open the Terminal.
  1. Type the following command and press Enter:
  1. When prompted, enter the current password for the user.
  2. When prompted, enter the new password for the user. Note that Linux passwords are case-sensitive and must be at least 8 characters long and include a mix of uppercase and lowercase letters, numbers, and symbols.
  3. When prompted, re-enter the new password to confirm.
  4. Once the new password has been set, you will see a message indicating that the password has been changed successfully.

Note that if you are not logged in as the user whose password you want to change, you will need to use the sudo command to run the passwd command with administrative privileges. For example, to change the password for the user “john”, you would run the following command:

sudo passwd john

You will be prompted to enter your own password to authenticate with administrative privileges before being able to change the user’s password.

Leave a Reply

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