How to Change a User’s Password on Ubuntu

This guide will show you how to change the password for a user on the Ubuntu operating system.

Change Ubuntu User Password

There are various reasons why you will want to change your password.

Some of these reasons include dealing with a potentially compromised password or improving its security, and changing the password of another user who has lost access.

Changing the password on an Ubuntu-based system is a straightforward process. This is thanks to the passwd tool and the simple Ubuntu Desktop GUI interface.

Using this tool, you can change the password for your current Ubuntu user. If you have superuser privileges, you can even change other users’ password, including the root user.

Remember that setting a secure password is crucial to maintaining the security of your Ubuntu operating system. This is especially true if you are using SSH on your Ubuntu system.

Table of Contents

Changing a User’s Password on Ubuntu using the Terminal

Using the command-line interface to change a user’s password on Ubuntu is a reasonably straightforward process.

For all of these steps, we will use the passwd tool to change the user’s password.

If you want to use the terminal on the desktop version of Ubuntu, you can quickly open the terminal by pressing CTRL + ALT + T.

Changing the Current User’s Password

The easiest way of using the passwd on Ubuntu is to change the current user’s password.

As you are already logged into the current user, you do not require superuser privileges.

1. Within the terminal on your Ubuntu device, you can change the current user’s password by using the command below.

By using the passwd tool without any arguments, it will only modify the current user.

passwd

2. To change the password for the current user, you will need to enter your current one.

This extra step makes it harder for someone to change your account’s password if you leave the terminal open.

Changing password for pimylifeup.
(current) UNIX password:

3. You need to enter the new password you want to set for your current Ubuntu user.

Enter new UNIX password:

4. To verify your new password, you will be required to enter it one last time.

Retype new UNIX password: 

5. If you typed in everything correctly, your Ubuntu user should now have a new password.

If you see the message below, then you can tell that the password has been successfully updated.

passwd: password updated successfully

Use passwd to Change Another User’s Password

We can use the same passwd tool also to change the password of another Ubuntu user.

To complete this, you will need to either use the root user or have a user with superuser privileges.

Using the passwd tool to modify the password of another user is incredibly straightforward. You only need to know the user’s username to proceed.

Syntax of Changing Another User’s Password

Below is the syntax of changing another user’s password using the passwd tool.

passwd [USERNAME]

Make sure that you replace “[USERNAME]” with the username of the user you want to change the password for.

Example of Changing a Different User’s Password in Ubuntu

To show you how this work,s we will give you an example of changing the password for a user called “examplepiuser“.

1. Let us start by modifying our example user’s password.

This process is as simple as using passwd followed by the name of our user.

sudo passwd examplepiuser

We use sudo so that we run the tool as a superuser. You won’t have to use sudo if you are using the root user.

2. Upon running the command, you will be asked to enter a password for the user you selected.

As we are now running as the superuser, we do not need to enter the users’ existing password to change them.

Enter new UNIX password:

3. Before the new password will be set, you will need to retype it.

Retype new UNIX password: 

4. If you have typed the new password correctly, you should see the following message appear.

This message tells you that you have successfully changed the password for the specified user.

passwd: password updated successfully

Changing the root User’s Password

In a typical Ubuntu installation, the root user will not have a set password and won’t be a user you can log in directly to.

This is to help maintain the security of the device. Not being able to log directly into the root user adds an extra barrier against attackers.

During the installation process for Ubuntu, you will be forced to make a new user. This new user is automatically given administrator (superuser) privileges on your system.

These superuser privileges allow your user to elevate itself to have the same sort of access as the root user. Every time you want to elevate your access, you need to re-enter your user’s password.

If you want to change the password for the root user, all you need to do is utilize the following command.

sudo passwd root

When using this command, you will be prompted to enter a new password for the root user.

Please note that you will be able to login directly to the root user upon setting a password.

Using the Ubuntu Desktop to Change a User’s Password

If you would prefer, you can use Ubuntu’s Desktop interface to change a user’s password.

The GUI is relatively straightforward to use and allows you to modify your user account’s password and others (If you have the correct privileges).

We will be showing the general steps for changing passwords on the Ubuntu 18.04 and 20.04 LTS releases.

If you are unsure what version of Ubuntu you are running, be sure to check out our guide.

Changing the User’s Password on Ubuntu 20.04 Desktop

Changing the password for users on an Ubuntu 20.04 desktop interface is a straightforward process.

Using this interface, you can modify both the current user and the other users on your Ubuntu operating system.

Opening the User Settings Screen

Our first task is to get to the user interface within the settings interface on our Ubuntu system.

This screen is what will allow us to modify our user’s passwords.

1. On the desktop of your Ubuntu 20.04 system, you should see icons on the screen’s top right.

You need to click these icons to proceed to the settings menu.

Opening the Ubuntu Quick Panel

2. You should now have a little popup menu on the top right of your screen.

In this menu, click the “Settings” option to open the settings interface.

Opening the Settings Interface Panel

3. You should now have the settings interface opened on your Ubuntu 20.04 device

In the sidebar, you should see the “User” option. Click it to change to this tab.

Switch to the Users Tab to Change Ubuntu an User's Password

Using the Interface to Change the Current User’s Password

If you want to change the password for the current user, then the process is straightforward on Ubuntu 20.04.

1. On this interface, you should see that your current user is already selected.

With it selected, we need to click the “Password” option underneath “Authentication & Login“.

Changing the Current Ubuntu User's Password

2. Using this dialog, you can finally change the password for your user on Ubuntu 20.04.

1. First, you need to type in your user’s current password (1.).

2. We next need to type in the new password you want to give this user (2.).

Try to include numbers and symbols to make your password harder to guess.

3. With your password set, you need to re-type it to confirm your password change (3.).

You are asked to reconfirm your password to avoid mistakes locking you out of your account.

4. You can save this password change by clicking the “Change” button located at the top right of the window (4.).

3. Ubuntu should now update your password to the one you specified.

You will need to use this when logging into Ubuntu from now on.

Modifying the Password of Another User

You can change the password for other users on your Ubuntu machine by using the same interface.

The interface will look ever so slightly different thanks to there being additional users.

1. At the top of the screen, you will see a message with a button with the text “Unlock

You need to click this button to authenticate yourself as an administrator.

Unlock Ubuntu Admin Settings to Change Passwords

2. You will need to use the interface that pops up to authenticate yourself.

All you need to do to authenticate yourself is to type in the password for your current user (1.).

With your password typed in, click the “Authenticate” button (2.).

Authenticate Ubuntu User using Password

3. Once you have authenticated yourself, you need to select the user you want to change the password (1.).

Once you have the user you want to change selected, click the “Password” option (2.) underneath “Authentication & Login“.

Choose Ubuntu User to Change Password For

4. You can now select how you want the new user’s password to be set.

First, decide if you want the user to select their password. For this example, we will be setting a password for this user (1.).

Next, enter the password that you want to be assigned to this user (2.).

To save the user’s password changes, you can now click the “Change” button at the top right of the window (3.).

Entering the new password for the Ubuntu User

Using Ubuntu 18.04 Desktop to Change Password

This section will explore how you can change the password on an Ubuntu 18.04 desktop interface.

While changing a user’s password is relatively similar to that of the more recent versions of Ubuntu, there are some slight differences.

Getting to the Edit User Screen

To modify a user on Ubuntu, we need to get to the user settings screen.

1. Start by clicking the top-right of your screen where the power, sound, and network icons are.

Clicking this will bring up a panel that gives us quick access to several things.

Opening the Quick Panel

2. On the panel that pops up, you need to find the screwdriver and spanner icon.

Click this icon to bring up the settings page.

Opening the Settings Screen

3. Now that we are on the settings screen, we need to find the user page.

We need to click the “Details” option in the left-hand sidebar.

Switching to the Details Tab

4. Our next step is to swap to the “Users” tab.

The “Users” tab will allow us to modify our users’ details, including their password.

Find this option in the left sidebar and click it.

Go to Ubuntu Users Settings Tab To Change Password

Modifying the Password of the Current User

If you only have a single user or only want to modify the current user, things are pretty straightforward.

1. With the current user-selected, you need to click the password field.

Clicking this field will allow us to change our Ubuntu user’s password.

Click Current Ubuntu Users Password Field

2. In the dialog box that appears, we can finally modify the current user’s password.

1. Before you can change the password, you need to enter the user’s current password (1.).

2. Your next step is to enter the brand new password for your account (2.).

Try to make this something secure and not easily guessable.

3. You will need to reconfirm your password by filling in the last textbox (3.).

This box is to help you from accidentally setting the incorrect password.

4. Confirm your Ubuntu user’s password change by clicking the “Change” button (4.).

Ubuntu Change Current User Password Dialog

3. Your new user should now be utilizing the password that you set.

When you log in to your device again, you will need to use this password.

Changing the Password of Another User

If you have multiple users set up on your Ubuntu device, it is also possible to modify their passwords using this same interface.

Of course, to do this, you must have a user that has superuser privileges.

1. At the top of the “Users” settings window, you should an “Unlock” button.

We need to click this button to authenticate ourselves as an administrator.

Unlocking Ubuntu User Interface

2. You will see a prompt asking you to authenticate yourself by typing in your password.

In the password box, type in the password for the account that you are currently using (1.).

With the password entered, click the “Authenticate” button (2.).

Authenticate Ubuntu User by Entering Password

3. When you have authenticated yourself, you should now click the user you want to modify (1.).

For our example, we are going to be editing our user called “example pi user“.

With your user selected, click the password textbox to begin changing it (2.).

Change Password for Other Ubuntu User

4. In this dialog, we can select whether we want to set the password now or allow the user to set it at their next login.

For this example, we will select the “Set a password now” option (1.).

Selecting this option will allow you to enter the password you want to set for the new user (2.).

Once you have a password entered, click the “Change” button (3.).

Enter Password for Different Ubuntu User

Conclusion

By this stage, you should now have a good understanding of how you can change a user’s password in Ubuntu.

We have shown you how easy it is to use the passwd tool in the terminal to modify any user’s password.

We also explored using the desktop interfaces for Ubuntu 18.04 and 20.04 and showed how you could change your current password in a couple of clicks.

If you have had any issues with changing your user’s password, please leave a comment below.

Be sure to  check out some of our other great Ubuntu guides. We also have Linux tutorials to help you navigate the operating system.

Leave a Reply

Your email address will not be published.