主机猫Hosting · Domains · Site Builders
EN
USD
How to recover or reset the root password on a CentOS server | Functions and Scope

How to recover or reset the root password on a CentOS server | Functions and Scope

Web Hosting

This host maintenance note, published on August 1, 2025, is titled "How to retrieve or reset the root password when it's forgotten on a CentOS server." The actual environment and tools involved include CentOS.

This host maintenance note, published on August 1, 2025, is titled "How to retrieve or reset the root password when it's forgotten on a CentOS server." The actual environment and tools involved include CentOS.

Software and deployment conditions

When booting up, in the GRUB boot menu interface (if it is not displayed, press and hold Shift or Esc during boot to force it to appear), select the first line (the default boot item), and press e to enter edit mode.

Parameters recorded in the original text

  • Version historyCentOS 8, CentOS 7

Matters mentioned in the article

  • First, restart the server. This can be done through the GRUB menu interface.
  • 3. Press Ctrl+X or F10 to enter Emergency Mode.
  • Second, remount the root file system for read and write access.
  • 1. After entering, the system will stop at the switch_root prompt. First, mount the root partition as read-write.
  • 2. Switch to the original system root environment
  • Third, reset the root password.
  • 1. Use the passwd command to change the password.

Related content

Request a quote

Tell us what you need and how to reach you.