Skip to main content
ubuntuask.com

Back to all posts

How to Change the Ubuntu Password?

Published on
7 min read
How to Change the Ubuntu Password? image

Best Ubuntu Security Tools to Buy in October 2025

1 Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop

Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop

  • SEAMLESS UBUNTU 24.04.3 LTS INSTALLATION ON MODERN PCS.

  • USER-FRIENDLY DESKTOP FOR BOTH LINUX BEGINNERS AND PROS.

  • FAST, RELIABLE BEAMO USB FOR QUICK AND EFFICIENT INSTALLS.

BUY & SAVE
$15.99
Beamo Ubuntu Desktop 24.04.3 LTS (Very Latest Release) 64-bit Bootable USB Flash Drive, Live USB for Installing and Repairing Ubuntu Desktop
2 Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black

Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black

  • ADVANCED THREAT PROTECTION FOR ULTIMATE SECURITY AGAINST MALWARE.

  • FASTER BOOT TIMES AND OPTIMIZED PERFORMANCE FOR PRODUCTIVITY.

  • WIDE HARDWARE SUPPORT AND EASY CLOUD INTEGRATION FOR VERSATILITY.

BUY & SAVE
$16.99 $17.99
Save 6%
Generic Ubuntu Linux 24.04 LTS (Latest Version) Bootable Live USB Flash Drive 64-bit for PC/Laptop, Black
3 Kali Linux OS for Hackers - Bootable Live Install USB Flash Thumb Drive - Cybersecurity Hacking Tools and Penetration Testing

Kali Linux OS for Hackers - Bootable Live Install USB Flash Thumb Drive - Cybersecurity Hacking Tools and Penetration Testing

  • DUAL USB/USB-C COMPATIBILITY: WORKS WITH ANY PC, OLD OR NEW!

  • SECURE AND PRIVATE: NO FORCED UPDATES, NO DATA COLLECTION, SUPERIOR PERFORMANCE!

  • OVER 600 TOOLS FOR ETHICAL HACKING: LAUNCH YOUR CYBERSECURITY CAREER TODAY!

BUY & SAVE
$20.99
Kali Linux OS for Hackers - Bootable Live Install USB Flash Thumb Drive - Cybersecurity Hacking Tools and Penetration Testing
4 FIDO U2F Security Key, Thetis [Aluminum Folding Design] Universal Two Factor Authentication USB (Type A) for Extra Protection in Windows/Linux/Mac OS, Gmail, Facebook, Dropbox, SalesForce, GitHub

FIDO U2F Security Key, Thetis [Aluminum Folding Design] Universal Two Factor Authentication USB (Type A) for Extra Protection in Windows/Linux/Mac OS, Gmail, Facebook, Dropbox, SalesForce, GitHub

  • STRONG AUTHENTICATION: SAFEGUARD ACCOUNTS FROM THEFT AND HACKING RISKS.

  • UNIVERSAL COMPATIBILITY: WORKS ON ANY U2F-SUPPORTED SITE WITH CHROME.

  • DURABLE & PORTABLE: METAL COVER AND COMPACT DESIGN FOR EASY TRANSPORT.

BUY & SAVE
$24.19
FIDO U2F Security Key, Thetis [Aluminum Folding Design] Universal Two Factor Authentication USB (Type A) for Extra Protection in Windows/Linux/Mac OS, Gmail, Facebook, Dropbox, SalesForce, GitHub
5 Ubuntu Desktop 25.04 Plucky Puffin USB Flash Drive

Ubuntu Desktop 25.04 Plucky Puffin USB Flash Drive

  • ENJOY 9 MONTHS OF SECURITY UPDATES UNTIL JANUARY 2026!
  • EXPERIENCE THE LATEST HARDWARE SUPPORT WITH LINUX KERNEL 6.14!
  • NEW GNOME 48 OFFERS BATTERY-SAVING MODE AND USER-FRIENDLY FEATURES!
BUY & SAVE
$18.99
Ubuntu Desktop 25.04 Plucky Puffin USB Flash Drive
6 Linux Security Cookbook

Linux Security Cookbook

  • AFFORDABLE PRICES ON QUALITY USED BOOKS FOR BUDGET-SAVVY READERS.
  • ECO-FRIENDLY CHOICE: PROMOTE SUSTAINABILITY WITH EVERY PURCHASE!
  • UNIQUE FINDS: DISCOVER RARE TITLES AND HIDDEN LITERARY GEMS TODAY!
BUY & SAVE
$20.79 $39.99
Save 48%
Linux Security Cookbook
7 Ubuntu Linux Toolbox

Ubuntu Linux Toolbox

BUY & SAVE
$37.92
Ubuntu Linux Toolbox
8 Kali Linux 2024.4 Bootable USB – Penetration Testing & Ethical Hacking Live OS Installer

Kali Linux 2024.4 Bootable USB – Penetration Testing & Ethical Hacking Live OS Installer

  • PORTABLE 8GB USB: CYBERSECURITY POWER ON THE GO.
  • INSTANT ACCESS: BOOT INTO KALI LINUX WITHOUT INSTALLATION HASSLE.
  • VERSATILE COMPATIBILITY: WORKS ON MOST MODERN COMPUTERS AND LAPTOPS.
BUY & SAVE
$16.99
Kali Linux 2024.4 Bootable USB – Penetration Testing & Ethical Hacking Live OS Installer
9 The Ultimate Ubuntu Handbook: A complete guide to Ubuntu 24.04, from installation to advanced security and development

The Ultimate Ubuntu Handbook: A complete guide to Ubuntu 24.04, from installation to advanced security and development

BUY & SAVE
$31.72
The Ultimate Ubuntu Handbook: A complete guide to Ubuntu 24.04, from installation to advanced security and development
10 Ubuntu Linux 15.10 'LinuxFreak Edition' 2-DVD SET - Includes both 32-bit and 64-bit Versions

Ubuntu Linux 15.10 'LinuxFreak Edition' 2-DVD SET - Includes both 32-bit and 64-bit Versions

  • UNLOCK CUTTING-EDGE FEATURES WITH THE LATEST UBUNTU 15.10 RELEASE!
  • ENJOY FREE UPDATES AND A VAST APPLICATION LIBRARY AT YOUR FINGERTIPS.
  • EXPERIENCE UNIQUE ARTWORK ALONGSIDE THE STANDARD UNITY INTERFACE!
BUY & SAVE
$10.95
Ubuntu Linux 15.10 'LinuxFreak Edition' 2-DVD SET - Includes both 32-bit and 64-bit Versions
+
ONE MORE?

To change the Ubuntu password, you can follow these steps:

  1. Open the terminal by pressing Ctrl+Alt+T or searching for "terminal" in the application launcher.
  2. In the terminal window, type the following command and press Enter: passwd
  3. You will be prompted to enter your current password. Type the password associated with your current user account and press Enter.
  4. Next, you will be asked to enter your new password. Type your desired new password and press Enter. Please note that while typing your new password, the characters will not be displayed on the screen for security purposes.
  5. The system will then ask you to retype the new password for confirmation. Type your new password again and press Enter.
  6. If the new password meets the system's requirements, it will be successfully changed, and you will see a message indicating the password has been updated.
  7. After changing the password, you can use your new password to log in to your Ubuntu system.

Remember, when entering passwords in the terminal, no characters will be displayed on the screen, including asterisks or dots. This is a security measure, so don't be alarmed if you don't see anything while typing your password.

What command should I use to change the password through the terminal?

The command to change a password through the terminal depends on the operating system you are using.

For Linux systems, you can use the passwd command. Open the terminal and type passwd, then press enter. You will be prompted to enter the current password and then the new password.

For macOS systems, you can also use the passwd command. Open the terminal and type passwd, then press enter. You will be prompted to enter the current password and then the new password.

For Windows systems, you can use the net user command. Open the Command Prompt or PowerShell and type net user [username] *, replacing [username] with the actual username. Then press enter and you will be prompted to enter the new password.

Can I change my password from the login screen itself?

It depends on the specific system or software you are using. In some cases, there may be an option or link on the login screen to change your password. However, in many cases, you may need to log in first and then navigate to your account settings or password settings to change your password.

Can I use special characters in my Ubuntu password?

Yes, you can use special characters in your Ubuntu password. The password can contain alphanumeric characters, as well as special characters such as !@#$%^&*. Including special characters can enhance the security of your password.

How can I change the password for a specific user other than the current user?

To change the password for a specific user other than the current user, you will typically need administrative privileges or root access on the system. The exact method may differ based on the operating system you are using. Here are the general steps:

  1. Windows: Open the "Control Panel" and navigate to "User Accounts" or "User Accounts and Family Safety". Choose "Manage another account" or "Manage Accounts" (depending on the Windows version). Select the user account you want to change the password for. Choose "Change the password" or "Change Password" and follow the prompts to set a new password.
  2. macOS: Open "System Preferences" from the Apple menu. Click on "Users & Groups" or "Users & Accounts". Authenticate with an administrator username and password. Select the user you want to change the password for from the user list. Click on the "Reset Password" or "Change Password" button and follow the prompts to set a new password.
  3. Linux (Ubuntu): Open the terminal. Type sudo passwd and hit Enter (replace with the actual username of the user you want to change the password for). Enter the sudo password when prompted. Follow the prompts to enter and confirm the new password.

Note: These instructions are general guidelines, and the exact steps may vary depending on your specific operating system version or distribution. It is recommended to consult the official documentation or specific OS resources for more detailed instructions tailored to your system.

How can I enforce password complexity rules in Ubuntu?

There are several ways to enforce password complexity rules in Ubuntu. Here are a few methods:

  1. Using the built-in PAM (Pluggable Authentication Module) configuration: Open the file /etc/pam.d/common-password in a text editor with root privileges. Look for the line that starts with password requisite pam_cracklib.so. Edit the line to add ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 at the end. For example: password requisite pam_cracklib.so ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1. These options define the password complexity requirements, where each character class (uppercase, lowercase, digit, other) is assigned a credit. A credit of -1 requires at least one character of that class. By setting all credits to -1, you ensure that at least one character from each class is necessary. You can also adjust the credits according to your needs. Save the file and exit the text editor.
  2. Using the libpasswdqc library: Install the libpam-passwdqc package by running the command sudo apt-get install libpam-passwdqc in your terminal. Open the file /etc/pam.d/common-password in a text editor with root privileges. Add the following line at the top of the file: password requisite pam_passwdqc.so retry=3 min=disabled,8,8,8,8. This line configures the libpam-passwdqc library to enforce password complexity rules, including a minimum length of 8 characters and at least one character from each character class. Save the file and exit the text editor.
  3. Using a third-party tool like cracklib: Install the cracklib-runtime package by running the command sudo apt-get install cracklib-runtime in your terminal. Open the file /etc/pam.d/common-password in a text editor with root privileges. Look for the line that starts with password requisite pam_cracklib.so. Edit the line to add ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 at the end, similar to the first method. Save the file and exit the text editor.

After implementing any of these methods, the next time a user changes their password, the complexity rules will be enforced according to the configuration you specified.

Can I change the password for remote access to my Ubuntu machine?

Yes, you can change the password for remote access to your Ubuntu machine. Here's how you can do it:

  1. Open the terminal on your Ubuntu machine.
  2. Type the following command and press Enter to open the SSH configuration file: sudo nano /etc/ssh/sshd_config
  3. Locate the line that starts with "PasswordAuthentication" and change its value from "yes" to "no". This step is optional but recommended for security reasons. It disables password-based authentication and forces the use of SSH keys instead. PasswordAuthentication no
  4. Save the changes by pressing Ctrl+O, then press Enter to confirm, and exit the nano editor by pressing Ctrl+X.
  5. Restart the SSH service to apply the changes by running the following command: sudo systemctl restart sshd
  6. Now, to change the password for your user account, type the following command and press Enter: passwd
  7. You will be prompted to enter your current password for verification.
  8. After verification, enter the new password you want to set and press Enter. You will be asked to retype the new password for confirmation.

Once you've completed these steps, the password for remote access to your Ubuntu machine will be changed. Ensure you remember the new password as it will be required for future remote access.

How often should I change my Ubuntu password for better security?

It is generally recommended to change your Ubuntu password periodically for better security. A common practice is to change it every 3-6 months, but the frequency may vary based on your specific needs and risk tolerance. Additionally, if you suspect any compromise or unauthorized access to your account, it is crucial to change your password immediately. Regularly updating your password along with practicing good password hygiene, such as using strong and unique passwords, can help enhance your security.