Change Linux User Account Password

You may have programs with their own user accounts (e.g. WordPress, MySQL, FTP server, mail server, cPanel, etc.). Generally, those accounts will be unaffected by changes made to your Linux account password.

Change Your Password (While Logged-in)

When logged in to Linux you can change your password just as you would change the password for a user account on a Mac or Windows PC.

Instructions

  1. Run Bash or a Terminal.
  2. Log into into your Linux computer/server.
  3. Enter passwd.
  4. Enter your current password, when prompted.
  5. Enter your new password, when prompted.
  6. Enter your new password again (to ensure you didn't mistype the first time).

Change password for any user

If you are logged into an account with administrative/root access, you can change the password of any user.

Syntax

sudo passwd [username]

Instructions

  1. Run Bash or a Terminal.
  2. Log into into your Linux computer/server.
  3. Enter sudo passwd.
  4. Enter your current password, when prompted.
  5. Enter your new password, when prompted.
  6. Enter your new password again (to ensure you didn't mistype the first time).

Example

sudo passwd root