Table of Contents
Ubuntu normally locks the root password and uses sudo for administrative commands. The password sudo requests is usually your own user's password, not a separate root password. Before resetting anything, identify which account you need to recover.
Use these procedures only on a machine you own or administer. Encrypted disks still require their unlock credentials, and a managed or cloud-hosted machine may require its administrator's recovery process.
If another administrator can sign in
For a forgotten local user's password, an authorized administrator can run the following, replacing username with the actual login name:
sudo passwd usernameIf the root account was deliberately given a password and you specifically need to replace it, use:
sudo passwd root
Authenticate with the administrator's sudo password if requested, then type the new target password twice. Terminal password prompts normally show no characters while typing. Read which account the command targets before confirming.


Setting a root password enables password authentication for that account; it is not needed for normal Ubuntu administration. Ubuntu's RootSudo explanation describes the default model.
If no local administrator can sign in
On an authorized local installation, Ubuntu's recovery environment may allow a password reset. Availability depends on bootloader protection, disk encryption and system configuration.
- Restart and display the GRUB menu. On many BIOS systems, holding Shift helps; on UEFI systems, tapping Esc may display it. Timing varies.
- Choose Advanced options for Ubuntu, then an entry marked recovery mode.
- Select the option to drop to a root shell. If it requires credentials you do not have, use the documented administrator recovery route instead.
- If the root filesystem is read-only, remount it read/write:
mount -o remount,rw /
The following screenshots illustrate GRUB and an alternative temporary kernel-edit workflow. For the standard recovery route above, use the recovery entry; do not copy a different computer's kernel path or replace its entire boot command.

A command-line shell started with a temporary init=/bin/bash boot edit is not the same environment as the normal recovery menu. Shutdown commands and available services can differ, so avoid mixing instructions between the two methods.
Reset the intended account
In the recovery root shell, reset your normal administrative user's password with:
passwd usernameOnly use passwd root when the explicit goal is changing a deliberately enabled root password. Running passwd without a username from a root shell changes root, which will not fix a forgotten ordinary user's login.


Enter the replacement twice and check for the successful-update message. If an authentication-token error appears, check whether the filesystem is writable and whether storage is full or reporting errors; do not repeatedly change unrelated files.


After a successful change, run sync, exit the recovery shell and use the recovery menu's normal boot option. Test the intended user's login after restarting.
Important recovery limits
A login-password reset does not recover a lost disk-encryption passphrase, decrypt an encrypted home automatically or necessarily unlock a keyring protected by the old password. Preserve backups and investigate those prompts separately.
The Ubuntu recovery-mode guide and lost-password documentation provide the applicable recovery context. Do not change SSH root-login policies or permanently weaken boot protection merely to regain a normal local account.
Reader Comments 0
Sign in with email or Google to join the discussion.