• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How to Change Root Password in Ubuntu 24.04 Using Terminal

How to Change Root Password in Ubuntu 24.04 Using Terminal

By Sourabh / July 26, 2024 Category: How To, Ubuntu

How to change root password in Ubuntu 24.04. Read this tutorial to find how to reset forgotten root password in Ubuntu Linux.

Regular User – Changing Root Password

To update or change the root password in Ubuntu 24.04 with sudo privileges, simply run the “passwd” command with the sudo privileges:

sudo passwd root

Root User – Changing Root Password

To change the password as a root user, first you will have to switch to the “Root User”. To do so, run the following command to log in as a root user:

sudo su -

Now run the passwd command to change the root password:

passwd

Once the root password is changed, exit from the root user – type exit in the terminal.

Resetting the Forgotten Root Password Using Recovery Mode

You can easily reset the forgotten root password from the recovery mode. Simply go through the following steps:

Step 1 : Boot into recovery mode and drop to root shell prompt. To do so, fresh start the system and while the machine is booting, press and hold the “ESC” key (press and hold the Shift key (for systems with BIOS) or the Esc key (for systems with UEFI)) from your keyboard to enter the GRUB menu. From there, select the “Advanced options for Ubuntu” using the arrow keys and hit the Enter key to proceed.
Step 2 : Now select the highlighted option and press Enter to boot the system into “recovery mode” and from the recovery menu, select the “Drop to Root Shell Prompt” option and press Enter. After this you will be asked to provide the root password for maintenance.
Step 3 : Enter the current root password and press Enter to log in as a root user.
Step 4 : Once you are logged into the root user, execute the following command to remount the root filesystem:

mount -rw -o remount /

Step 5 : Now run the passwd command to easily reset your forgotten root password:

passwd root

Once you are done, run the “exit” command to exit from the root shell prompt and go back to the recovery menu. From there, select the “Resume Normal Boot” option.

That’s all, now you shall be able to log in with the new root password.

Primary Sidebar

Latest Posts

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

How To Shutdown Linux With A 15 Minute Delay And Message

Free AI Courses With Certificate For Beginners In India

Best AI Plugins For WordPress To Use In 2026

3 Commands To Check USB Connection In Linux Terminal

Linux Terminal Commands for Beginners With Examples

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap