Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Change a Password in Linux

This guide shows you how to change your own password and the password of another user on a Linux server.

VPS and Cloud Servers2 min read10 steps

What is the terminal?

The terminal is a screen where you type commands to tell the computer what to do. On a VPS you reach it using SSH. SSH is a safe way to control a server from far away.

Change your own password

  1. Log in to your server over SSH.
  2. Type this command and press Enter:
    passwd
    This starts the password change for the user you are logged in as.
  3. When asked for the current password, type it. The screen shows nothing while you type. This is normal.
  4. Type your new password and press Enter.
  5. Type the new password again to confirm.
  6. Look for the message that says the password was updated.

Change another user's password

You need root access or sudo rights for this. Root is the all-powerful admin user. Sudo lets a normal user run admin commands.

  1. Log in as root, or as a user who can use sudo.
  2. Type the command with the user name at the end. Here the user is called john:
    passwd john
    If you use sudo, type sudo passwd john.
  3. Type the new password and press Enter.
  4. Type it again to confirm.

You do not need the old password when you change it as root.

Make a strong password

  • Use at least 12 characters.
  • Mix capital letters, small letters, numbers and symbols.
  • Do not use your name, birthday or common words.
  • Use a different password for every account.

If it does not work

  • "Authentication token manipulation error" can mean the disk is read-only or full.
  • "Password is too simple" means the system wants a stronger one.
  • "Permission denied" means you need root or sudo.
Tip: Changing the root password can lock you out if you mistype it. Keep your current session open until you have tested the new password in a second window.

Quick recap

  • Type passwd to change your own password.
  • Type passwd username as root to change another user's password.
  • The screen shows nothing while you type a password.
  • Choose a long and unique password.
  • Test the new password before closing your old session.