The objective of this tutorial is to reset a lost root or user password on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to gain root shell without password
- How to mount root (/) directory read/write
- How to reset root password
- How to reset user password
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Ubuntu 20.04 reset root password step by step instructions
Troubleshooting
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchanged
Your root partition is mounted read-only. Try:
# mount -o remount,rw /
to resolve this issue.
[ end Kernel panic - not syncing: Attempted to kill init! exit code=0x0007f00
Make sure that you removed the splash
boot option when editing the grub’s menu item.
When trying to reboot with the reboot
command I get:
Failed to connect to bus: No such file or directory Failed to talk to init daemon.
Ignore, and reboot with:
# exec /sbin/init