How to Change Passwords in Ubuntu: A Complete Guide for Beginners and System Administrators

1. Introduction

The Importance of Changing Passwords in Ubuntu

Ubuntu is an open-source Linux distribution used by millions of users around the world. Its ease of use and strong security features make it popular among individuals, companies, and developers. However, as part of maintaining security, regularly changing your password is essential. Using the same password for long periods can increase the risk of unauthorized access, so caution is necessary.

Passwords are a critical component that controls access to the system. If you want to prevent unauthorized users from accessing your computer, strengthening your password and changing it regularly is indispensable. Password management becomes especially important when sharing a device with family, friends, or colleagues, or when working in a remote environment.

Who Is This Guide For?

This guide is written primarily for beginner Ubuntu users and those who use Ubuntu frequently but feel uncertain about their security practices. It also provides useful information for IT professionals and system administrators by explaining procedures to minimize security risks. Even beginners can follow along, thanks to illustrated examples of commands and GUI-based steps.

2. How to Change a Password in Ubuntu (Basic Methods)

In Ubuntu, the most common way to change a password is by using the Command Line Interface (CLI). This method is efficient and easy enough for beginners to perform. Below are the basic steps for changing your password.

2.1 How to Change Your Own Password

The most basic way to change your password is by using the passwd command. Running this command allows you to update the password for your current account.

Steps:

  1. Open the Terminal
    Open the Terminal on your Ubuntu desktop. You can easily access it by pressing Ctrl + Alt + T.
  2. Run the passwd command
    Enter the following command:
   passwd

This command changes the password for the currently logged-in user.

  1. Enter your current password
    The system will ask for your current password. Enter it and press Enter.
  2. Set a new password
    You will be prompted to enter your new password twice. Enter it once, then re-enter it to confirm. The password will then be updated.

Password Change Success Message

When the password is successfully updated, a message like this will appear:

passwd: password updated successfully

Your password has now been updated.

2.2 How to Change Another User’s Password

If you are a system administrator and need to change another user’s password, use the sudo command. Administrative privileges are required for this operation.

Steps:

  1. Run the sudo passwd [username] command
    Use the following command to change another user’s password:
   sudo passwd [username]

For example, to change the password of a user named john, enter:

   sudo passwd john
  1. Enter your administrator password
    You will be prompted to enter your own administrator password. Enter it and press Enter.
  2. Set the new password
    Enter the new password for the target user twice. The password will then be updated.

This method is useful when users cannot change their passwords themselves and requires administrative intervention.

3. Changing Passwords Using the GUI

Ubuntu also allows you to change passwords through the Graphical User Interface (GUI), eliminating the need for command-line operations. This method is especially helpful for users who are unfamiliar with terminal commands. The following steps explain how to change passwords using the GUI.

3.1 Open the Settings Screen

  1. Access the “Settings” menu
    First, open the Ubuntu “Activities” overview. Click the “Activities” button in the top-left corner and type “Users” into the search bar. When the “Users” option appears, click it to open the settings panel.
  2. Open the “Users” settings panel
    Once opened, the panel will display details for the current user, which is where password changes can be made.

3.2 Steps to Change a Password

  1. Select the “Password” field
    Click the password field (displayed as dots such as ●●●●●). To change another user’s password, click the “Unlock” button first to enable administrator privileges.
  2. Enter your current password
    You must verify your current password before making changes. Enter your password and click “Confirm”.
  3. Enter a new password
    Type your new password, then re-type it to confirm. Choose a strong password for better security.
  4. Complete the password change
    Click the “Change” button to save the new password. It will be used starting from the next login.

3.3 Changing Other Users’ Passwords

To change another user’s password as an administrator, first click the “Unlock” button and enter the administrator password. Then select the user account and follow the same steps to set a new password.

3.4 Advantages and Precautions of the GUI Method

The GUI method is intuitive and reduces the risk of errors, making it ideal for beginners. Since it doesn’t require complex commands, it offers a more comfortable experience. However, because administrators can change other users’ passwords, proper security measures must be followed.

4. What to Do If You Forget Your Password

If you forget your Ubuntu password, you won’t be able to log in normally. However, you can reset your password using the GRUB menu or recovery mode. This section explains how to reset a forgotten password.

4.1 Resetting the Password Using the GRUB Menu

When a password is forgotten, the most common method is to boot into recovery mode using GRUB (Grand Unified Bootloader) and reset the password as the root user.

Steps:

  1. Display the GRUB menu
    Restart the computer and press and hold the “Shift” key during boot to display the GRUB menu. If it doesn’t appear, try again.
  2. Select Recovery Mode
    Choose “Advanced options for Ubuntu” and then select a recovery mode option (e.g., “Ubuntu, with Linux 5.x.x-xx-generic (recovery mode)”).
  3. Launch the root shell
    From the menu options, choose “root” to access a root shell.
  4. Enable write permissions
    By default, the file system is mounted as read-only. To modify it, run:
   mount -o remount,rw /
  1. Reset the password
    Enter the following command while specifying the username:
   passwd [username]

For example, to reset the password for “john”, use:

   passwd john
  1. Enter a new password
    Enter the new password twice when prompted.
  2. Reboot the system
    Restart the machine using the command below:
   reboot

5. Best Practices for Password Management

Password management in Ubuntu is critical for maintaining system security. Weak password practices can compromise the entire system. This section explains how to create strong passwords and manage them safely.

5.1 Choosing a Strong Password

Password strength directly affects system security. Simple or short passwords increase the risk of unauthorized access. Consider the following points to create a strong password:

Length and Complexity

A strong password should be long and complex. While 8 characters is acceptable, 12 or more is recommended. Include:

  • Uppercase and lowercase letters
  • Numbers
  • Symbols (e.g., @, #, &)

Example: Pa$$w0rd!2024

Protection Against Dictionary Attacks

Passwords that contain dictionary words are easy to guess. Avoid common words like password123 or letmein.

Using Passphrases

A passphrase combines multiple words into a single password. Random or unrelated words create a strong and memorable password.

Example: DogRunsInCloudySky2024!

5.2 Using a Password Manager

Remembering unique strong passwords for each service can be difficult. A password manager securely stores all your passwords and generates random, complex ones when needed.

Recommended Password Managers

  • KeePass: Free, open-source, and stores encrypted password databases locally.
  • Bitwarden: Open-source with cloud sync support for multiple devices.

5.3 Enabling Two-Factor Authentication (2FA)

Two-Factor Authentication (2FA) adds an extra layer of protection by requiring an additional code, usually generated on a mobile device.

Benefits of 2FA

  • Even if a password leaks, the account cannot be accessed without the authentication code.
  • Many online services and Ubuntu’s SSH configuration support 2FA.

5.4 Changing Passwords Regularly

Even strong passwords should be updated periodically. Changing passwords every 3–6 months minimizes risk in case a previous password has leaked.

年収訴求