How to Change User Password in Ubuntu
Introduction
Before we begin talking about how to change User Password in Ubuntu, let's briefly understand-Who can change the User Password in Ubuntu?
It is very simple to change/update the password in the Ubuntu command line. You can only update your own password as a regular user. The root user and users with sudo access can modify the passwords of other users and specify how they can be used or updated.
This tutorial will show you how to change a user's password in Ubuntu using the command line or the GUI.
Ubuntu Change Password from Command Line
The passwd
command in Ubuntu and other Linux distributions can be used to change a user account's password.
Run the passwd
command without any parameters to update your user account password:
passwd
Your current password will be required to be entered. If the password is correct, you will be prompted to create a new password and confirm it.
Output
Changing password for linuxize.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
When you type your password, it is not displayed on the screen.
Use the new password the next time you log in to your Ubuntu machine.
Change Another User’s Password
To change or reset another user's passwords, the user you're logged in as needs sudo access.
Run the passwd
command followed by the username to change the password of another user account. Run the following command to change the password of a user named sansa
, for example:
sudo passwd sansa
You'll be asked to type in and confirm your new password:
Output
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Ubuntu Change Password from GUI
If the command line isn't your thing, you can use the GUI to change your user password.
In Ubuntu 18.04, Gnome is the default desktop environment (Bionic Beaver). Unity was the default desktop environment in previous Ubuntu releases.
To change your user password, follow the procedures below:
- Click the Settings icon to open the system Settings window, as illustrated in the image below.
2. Click the Users tab in the system settings box.
To update the passwords of other users, you must first unlock the panel, which requires sudo (administrator) capabilities.
3. Click on the ·····
input next to Password to open the Change Password dialog.
4. Enter your current password, then the new password and confirm it.
To generate a random password automatically, click the double gear symbol next to New Password.
4. To save the new password, click Change.
That's it! The password has been successfully updated.
FAQs to Change Password in Ubuntu
How can I change my password in Ubuntu?
You can change your password in Ubuntu by using the passwd
command.
Do I need administrator privileges to change a password in Ubuntu?
Yes, you need to have root or superuser privileges to change passwords for other users or the system.
Can I change my password from the graphical user interface in Ubuntu?
Yes, you can change your password from the graphical user interface by going to System Settings > Users.
Is it possible to change the password for another user without being root?
No, you need to have root privileges or be using the sudo
command to change another user's password.
Can I change a password without entering the old password?
Yes, if you are the root user or using the sudo
command, you can change a user's password without providing the old password.
What should I do if I forget my password in Ubuntu?
If you forget your password, you can reset it by accessing the root shell during the boot process.
Can I change the password from a remote SSH session?
Yes, you can change your password from a remote SSH session by using the passwd
command.
Conclusion
I hope this tutorial will help you to understand how to change user passwords in Ubuntu.
Make sure you use a strong and unique password when updating your password. The most critical part of your account's security is having a strong password and a strong password usually comprises at least a combination of 16 characters that includes at least one uppercase, one lowercase, one numeric, and one special character.
If you have any queries, please leave a comment below and we’ll be happy to respond to them.