reset root password in ubuntu

How to Reset Password in Ubuntu

Sometimes you may need to reset root password or login password because you may have forgotten password. In this article, we will look at how to reset password in Ubuntu.

How to Reset Password in Ubuntu

Here are the steps to reset password in Ubuntu.

1. Boot up in Recovery mode

When the system boots, hit Shift key after BIOS screen. For some systems, you may need to hit Esc key instead of Shift key. You will see the following menu.

reset password ubuntu

Use down arrow key to move down through the options, select option 2 (which has recovery mode in its description) and hit enter.

You will see the following screen. Use down arrow key again to go down to option root and then hit enter key.

reset password ubuntu

2. Remount Filesystem with Write Permission

You will see the following prompt. At this stage, you only have access to a read-only file system.


Run the following command to remount the filesystem with write permissions.

mount -o remount,rw /

3. Reset Password

Reset Ubuntu password with passwd command followed by your root user’s username. Replace root_user below with your root user’s username. You will be prompted to enter and re-enter new password.

root@ubuntu:~# passwd root_user
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Finally, reboot your ubuntu system with sudo reboot command. This time, you can log in with your new password.

Also read :

How to Resolve Unmet Dependencies in Ubuntu
How to Execute Shell Command in Python
How to Copy Files from One Directory to Another
Grep: Exclude Directory & Files
How to Install Fail2ban in CentOS 7

Leave a Reply

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