How to Change Password on Ubuntu 22.04 2

How to Change Password on Ubuntu 22.04

In Linux-based systems such as Ubuntu 22.04, there is an account that is referred to as a root account. This account has access to all commands and resources present on the system and requires the user to set a password for this account. If you wish to change this password or, for some reason, have forgotten your existing password, then follow our post as we will guide you about changing passwords on Ubuntu 22.04 system.

How to change password on Ubuntu 22.04

Here, we have summed up all the required steps that will lead you to successfully change your password on Ubuntu 22.04. So, let’s start!

Step 1: OpenGrub Menu
If you wish to change your root account password, then you need to open the Grub menu on your Ubuntu 22.04. In order to do so, you need to first restart your system and then quickly press and hold the “Shift” key when the system is restarting:

How to Change Password on Ubuntu 22.04 3

Step 2: Edit Grub Menu
Now you need to change the default boot entry of the system and for that press the “E” button on the keyboard. This will allow you to make changes to the GRUB menu:

How to Change Password on Ubuntu 22.04 4

Once you are in the edit mode, bring your keyboard cursor to the line starting with the word “linux” using the arrow keys and write the following command at the end of that line:

rw init=/bin/bash

Output

How to Change Password on Ubuntu 22.04 5

Now boot the system with the new configuration using Ctrl+X, or F10.

Step 3: Check Access
After performing the above step, you will be given root access. Now ensure that you have read and write access to the file system where Ubuntu 22.04 is installed. To evaluate this, run this command:

mount | grep -w /

Output

How to Change Password on Ubuntu 22.04 6

If you see the above-given output, then it means you have read and write access.

Step 4: Change Password
Now run the following command to change the password on your Ubuntu 22.04 system and enter the new password:

passed

Output

How to Change Password on Ubuntu 22.04 7

However, if you wish to change the password for another user account rather than the root account, then utilize the command and specify the “username” in it:

passwd username

Step 5: Reboot system

Now reboot the Ubuntu 22.04 system using the below-mentioned command and press Enter to log in with the new password:

exec /sbin/init

How to Change Password on Ubuntu 22.04 8

That was all about changing the password on Ubuntu 22.04. Give it a try on your system.

Conclusion

In order to change the password on Ubuntu 22.04, you need to open the Grub menu and edit this menu by pressing the “E” key. Once in the edit mode, make the specified configurations. After saving them, evaluate whether you have read and write access to the file system or not and change your password using the system password with the “passwd” command and reboot the system to log in with the new password. This post discussed the method to change passwords on Ubuntu 22.04 system.

Leave a Comment

Your email address will not be published. Required fields are marked *