Reset Ubuntu Password - Quick & Easy Guide

Recovering a Forgotten Ubuntu Password
Misplacing a password is a common technological frustration, and a frequent source of tech support requests. Fortunately, Ubuntu provides a straightforward method for password resets.
The process involves minor adjustments to the boot parameters and executing a few commands. We will guide you through each step.
Resetting Your Ubuntu Password
Begin by rebooting your computer. As the GRUB loading screen appears, promptly press the ESC key to access the menu.
Root Shell Access – A Simplified Approach
If available, select the "recovery mode" option from the menu. This is typically positioned directly below your standard kernel selection.
From this menu, choose "Drop to root shell prompt."
This action will provide you with a root shell prompt.
Alternative Root Shell Access Method
Should the recovery mode option be unavailable, you can manually modify the GRUB options to enable a root shell.
First, select your usual boot kernel (generally the default option). Then, press the "e" key to edit this boot entry.
Next, use the down arrow key to navigate to the "kernel" option, and press "e" again to enter edit mode for that line.
You will then see a screen resembling the following.
Remove the "ro quiet splash" portion using the backspace key. Subsequently, append the following to the end of the line:
rw init=/bin/bash
After modifying the kernel line, press enter. Then, press the B key to boot using the altered configuration.
The system should now boot rapidly to a command prompt.
Changing the Password
To reset your password, utilize the following command:
passwd <username>
For instance, if your username is "geek," the command would be:
passwd geek
Following the password change, execute these commands to reboot the system. The 'sync' command ensures data is written to disk before rebooting.
sync
reboot --f
In some instances, the '--f' parameter may be necessary for the reboot command to function correctly. Alternatively, a hardware reset can be performed, but always use the 'sync' command beforehand.
You should now be able to log in without any difficulties.
Linux Commands | ||
Files | tar · pv · cat · tac · chmod · grep · diff · sed · ar · man · pushd · popd · fsck · testdisk · seq · fd · pandoc · cd · $PATH · awk · join · jq · fold · uniq · journalctl · tail · stat · ls · fstab · echo · less · chgrp · chown · rev · look · strings · type · rename · zip · unzip · mount · umount · install · fdisk · mkfs · rm · rmdir · rsync · df · gpg · vi · nano · mkdir · du · ln · patch · convert · rclone · shred · srm · scp · gzip · chattr · cut · find · umask · wc · tr | |
Processes | alias · screen · top · nice · renice · progress · strace · systemd · tmux · chsh · history · at · batch · free · which · dmesg · chfn · usermod · ps · chroot · xargs · tty · pinky · lsof · vmstat · timeout · wall · yes · kill · sleep · sudo · su · time · groupadd · usermod · groups · lshw · shutdown · reboot · halt · poweroff · passwd · lscpu · crontab · date · bg · fg · pidof · nohup · pmap | |
Networking | netstat · ping · traceroute · ip · ss · whois · fail2ban · bmon · dig · finger · nmap · ftp · curl · wget · who · whoami · w · iptables · ssh-keygen · ufw · arping · firewalld |
SEE ALSO: Best Linux Laptops for Developers and Enthusiasts