How to Change Root Password in Ubuntu (2026)

UbuntuRoot2026 Updated

Need to change the root password in Ubuntu? Here's the step-by-step guide for 2026, including reset methods and security tips.

Quick Method:Open terminal → sudo passwd root→ Enter new password twice.

TE Guide Framework: This guide follows our methodology: Understand (what and why), Apply (step-by-step instructions), Verify (how to confirm it worked). Every step has been tested and verified for 2026 accuracy.

Method 1: Change via Terminal (Easiest)

  1. 1Open terminal (Ctrl+Alt+T)
  2. 2Type: sudo passwd root
  3. 3Enter your user password (not root yet)
  4. 4Type new root password (won't show)
  5. 5Retype new root password → Done!

Method 2: Reset Forgotten Root Password

⚠ If you forgot the root password:

  1. Restart Ubuntu → Hold Shift for GRUB menu
  2. Select "Advanced options" → Recovery mode
  3. Select "root - Drop to root shell"
  4. Type: mount -o remount,rw /
  5. Type: passwd root
  6. Enter new password twice → Type reboot

Method 3: Enable/Disable Root Account

Enable Root Login

To allow root login via SSH:

sudo passwd -u root

Disable Root Login

To block root login (recommended):

sudo passwd -l root

Password Requirements (2026)

RuleRecommendation
LengthMinimum 12 characters
ComplexityUppercase + lowercase + numbers + symbols
AvoidDictionary words, birthdays, "password123"
ManagerUse password manager (generate random)

Security Best Practices

✓

Use sudo, not root

Run admin commands with sudo instead of logging in as root.

✓

Disable SSH root login

Edit /etc/ssh/sshd_config → Set "PermitRootLogin no".

✓

Set sudo timeout

Run sudo visudo→ Add "Defaults timestamp_timeout=10".

FAQ

What is the default root password?

Ubuntu disables root by default. There is no default password - you must set one.

Can I use root for daily work?

No! Use a regular user with sudo privileges. Root is for system maintenance only.

Why can't I ssh as root?

Ubuntu blocks root SSH by default. Use a sudo user and run "su -" to become root.