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.

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.

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.
root@ubuntu:~#
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 root@ubuntu:~#
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
Related posts:
Linux Rename File Starting with Dash
How to Know Which Shell I am Using in Linux
How to Improve Ubuntu Speed & Performance
How to Change Color Scheme in Vim
How To Make File Executable in Linux
How to Use Auto Indent in Vi Editor
How to Install Http Server in Raspberry Pi
How to Create ISO Image from CD in Linux

Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.