ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04

Forgot your Ubuntu login password? Well, this quick tip is going to show you how to reset user (or root) password in Ubuntu 16.04 LTS.

It’s easy to change a password in Ubuntu Linux via passwd command. The key is how you can get into the root command console with super user privilege.

1. Boot into root shell:

For those who have not enabled root user, it’s easy to get into the root shell via the recovery mode from Grub boot-loader. To do so:

1. Start your computer, when you’re at Grub boot-loader, select Advanced Options for Ubuntu and then select boot with the recovery mode.

recovery mode

Tip: For single system and single kernel, you may press and hold Shift key to show Grub while starting up.

2. At Recovery Menu, select “Drop to root shell prompt” and hit Enter.

root shell

Hit Enter again or type in root password if enabled, and continue changing your password via the “Reset password” section (see below).

For those who forgot the root password, you can still get into passwordless root shell by adding kernel parameter in boot menu:

1. Boot into Grub menu, and highlight the default Ubuntu entry.

grub menu

2. Press ‘e‘ on your keyboard to edit the boot parameter, then scroll down and add init=/bin/bash in the end of kernel (or linux) line.

edit boot parameter

Then press Ctrl+X or F10 will boot directly into root shell prompt without password.

Reset Password:

Once you’re in root shell, run the commands below one by one to reset forgotten passwords:

1. Remount Ubuntu system with read and write permission:

mount -rw -o remount /

2. Check the username if you forgot it:

ls /home

3. Reset password via command:

passwd USERNAME_HERE

or use passwd root to reset the root password.

reset password

Finally run reboot command to reboot or resume normal boot and login with the new password.

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 17604 times since Sat, Jun 2, 2018
Odpalenie polecenia tylko na jedną godzinę
Viewed 1459 times since Thu, May 24, 2018
How To Find Largest Top 10 Files and Directories On Linux / UNIX / BSD find
Viewed 1051 times since Mon, Oct 29, 2018
6 easy steps to setup offline two factor authentication in Linux
Viewed 9335 times since Mon, Apr 6, 2020
Migrate a Linux System from Red Hat Enterprise to CentOS
Viewed 8688 times since Fri, May 15, 2020
How to run command or code in parallel in bash shell under Linux or Unix
Viewed 1511 times since Tue, Aug 6, 2019
Enabling or disabling a repository using Red Hat Subscription Management
Viewed 1946 times since Mon, Oct 29, 2018
SYS: Configure a local repository. local repo
Viewed 9082 times since Mon, Oct 29, 2018
Procedura powiekszania OCFS2 online
Viewed 4446 times since Fri, Jun 8, 2018
YUM How to use yum command on CentOS/RHEL
Viewed 3351 times since Thu, Oct 25, 2018