• 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 If Forgotten

How To Change Root Password In Ubuntu If Forgotten

By Sourabh / August 17, 2023 Category: How To, Ubuntu

Change sudo password in Ubuntu Terminal or reset root password Ubuntu. Here is how to change root password in Ubuntu using terminal.

Open Terminal and run the following command to enter sudo/superuser mode:

sudo -i

The sudo allows a permitted user to execute a command as the superuser or another user. Once you are logged in as root user; you can see that root indication in the command prompt on the terminal screen.

Now change the passwd for the root user by using the passwd command. Simply run the following command:

passwd

The passwd command changes passwords for user accounts.

A normal user may only change the password for his/her own account, while the superuser may change the password for any account. passwd also changes the account or associated password validity period.

NOTE: Password Changes The user is first prompted for his/her old password, if one is present. This password is then encrypted and compared against the stored password. The user has only one chance to enter the correct password. The superuser is permitted to bypass this step so that forgotten passwords may be changed.

The user is then prompted twice for a replacement password. The second entry is compared against the first and both are required to match in order for the password to be changed.

Then, the password is tested for complexity. Note that the passwords should consist of 6 to 8 characters including one or more characters from each of the following sets:

  • lower case alphabetics
  • digits 0 to 9
  • punctuation marks

Now exit the root login and exit the terminal. Use the command exit.

Primary Sidebar

Latest Posts

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

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

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

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