Want to change root password in Ubuntu? Learn how to change the password of any user on Ubuntu Linux. Terminal and GUI methods have been discussed.
When do you need to change password in Ubuntu? Let me give you a couple of scenarios.
When you install Ubuntu, you create a user and set a password for it. It could be a weak password or maybe a little too complicated and you want to change it.
If you are a system administrator, you may need to change the password of other system users.
You may have a few other reasons for doing this. Now comes the question, how to change a user’s password on Ubuntu or Linux?
In this quick tutorial, I will show you the command line and GUI ways to change passwords in Ubuntu.
Change User Password via Command Line Change User Password Root Change User Password via GUI Change User Password in Ubuntu
- Changing User Password
in Ubuntu is very simple. In fact, it’s the same with any Linux distribution because it uses the generic Linux command called passwd for this purpose.
If you want to change your current password, simply run this command in a terminal:
You will be asked to enter your current password and the new password twice
You won’t see anything on the screen as you type the password. This is perfectly normal behavior for UNIX and Linux.
passwd Password change for abhishek. (current) UNIX password: Enter the new UNIX password: Retype the new UNIX password: passwd: password updated successfully
Since this is your administrator account, you just changed the sudo password in Ubuntu without even realizing it
If you want to change the password of some other user, you can also do so with the passwd command. But in this case, you will have to wear sweat.
sudo passwd <user_name>
If you changed your password and forgot it later, don’t worry. You can easily reset Ubuntu password.
Change Root Password
By default, the root user in Ubuntu does not have a password. Don’t be surprised. You don’t use the root user in Ubuntu all the time. Confused? Let me explain it to you quickly.
When installing Ubuntu, you are forced to create a user. This user has administrator access. This administrator user can gain root access by using the sudo command. But it uses its own password, not the root account password (because there isn’t one).
You can set or change the root password by using the passwd command. However, in most cases, you don’t need it and you shouldn’t.
You’ll need to use sudo (with an account with administrator privileges). If the root password does not have a password previously configured, it prompts you to set it. Otherwise, you can change it using the existing root password.
sudo passwd root
Change Ubuntu password using GUI
I have used GNOME desktop with Ubuntu 18.04 here. The steps should be more or less the same for other desktop environments and Ubuntu versions.
Go to Menu (press Windows/Super key) and find Settings.
Under Settings, scroll down a bit and go to Details.
Here, click on Users to access all the users available on your system.
You can select any user you want, including your primary administrator account. You need to unlock the users first and then click on the password field.
You will be prompted to set the password. If you are changing your own password, you will also need to enter your current password.
Once done, click on the Change button at the top. That’s all. You have successfully changed the user password in Ubuntu.
I hope this little quick tip helped you change user password in Ubuntu. If you have questions or suggestions, please leave a comment below.