How to Change Your User Password In Linux

Linux set password instructions

Image of user login.


The strength of our passwords matter. We need to use very strong passwords and change them from time to time (if not regularly) to keep our data and personal information secure. 

With the Linux operating system, it’s really easy to change your user password. Surprisingly enough, it’s easier to change that password from the command line than it is from the graphical user interface (GUI), although that process is simple as well.

Let’s find out just how easy it is to change your Linux password from both the command line and the GNOME desktop.

Version Information

The method for changing passwords from the command line can be successfully done on any version of Linux, regardless of release or distribution. For the GUI, we’ll be demonstrating on Pop!_OS, running GNOME 3.32-1.

Linux: Change Password

How you change your password from the command line is accomplished with the passwd command. Don’t let the idea of the command line scare you off from this (as it’s incredibly simple). Here’s how to use this command:

  1. Open a terminal window.

  2. Issue the command sudo passwd.

    Screenshot of the passwd command.
  3. When prompted, type your current user password.

  4. Type the new password.

    Screenshot of typing a new user password.
  5. Verify the password by typing it a second time.

  6. Close the terminal window.

That’s it. Once you’ve verified the password, you are ready to go. There’s no need to log out and log back in, as the password change will take effect immediately.

Linux: Reset User Password

What if you have other users on your Linux machine and you need to change their passwords? This is almost as easy as changing your own password. Before you do this, however, you want to make sure the user isn’t logged into the system. Here’s how to change their password:

  1. Open a terminal window.

  2. Issue the command sudo passwd USERNAME (where USERNAME is the name of the user whose password you want to change).

    Screenshot of changing another user's password.
  3. Type your user password.

  4. Type the new password for the other user.

  5. Retype the new password.

    Screenshot of retyping a new password.
  6. Close the terminal.

Once you’ve successfully changed the password, have the other user attempt to log into their account. They shouldn’t have any problem logging in with the new password.

Using a GUI

If you prefer to use a GUI over the command line, how this is done will vary, depending on which desktop you use. Let’s take a look at how a password change is handled through the GNOME Desktop.

  1. Open the Settings tool.

  2. Click Details.

    Screenshot of the Settings window.
  3. Click Users and then click Unlock.

    Screenshot of the Unlock button.
  4. When prompted, type your current user password.

  5. Click in the Password text area.

  6. When prompted, type and verify the new password and click Change.

    Screenshot of changing a user password with the GNOME GUI.
  7. Close the Settings window.

And that’s all there is to changing a user password from within the GNOME desktop. Most Linux desktop GUIs will offer a very similar means for changing a user password, via a user-friendly GUI. You now have the ability to change your user password, no matter what desktop or distribution you use.