Skip to main content

RHEL CentOS & Fedora: How to Reset Forgotten Root Password


RHEL CentOS & Fedora: How to Reset Forgotten Root Password

Resetting the forgot root user password usually only takes a few simple steps that will help you through the process of resetting the root password and logging in with the new password.

To begin, restart your machine and select the kernel you want to boot into from the boot grub menu by pressing the 'e' key on your keyboard.


The following kernel boot parameters will appear on the next screen; locate the line that begins with (kernel=) and add the parameter (rd.break) at the end as indicated, then click Ctrl + x.


You'll be taken to emergency mode on the next screen; hit Enter to enter the shell prompt. Now, double-check that you have read and write permissions on the sysroot directory. It's mounted in read-only mode by default, which is denoted by the letter ro.

Remount the sysroot directory with read and write rights, then double-check the permissions. The permissions have changed from ro (read-only) to rw (read and write) this time, as shown.

Then, using the following command, mount the root file system in read and write mode.

Then, using the passwd command, change the root password to the new one and confirm it.

You've successfully reset your root user password at this point. The only thing left is to rename all of the files to reflect the correct SELinux contexts.

To start the SELinux relabeling process, type exit and then log out.


This usually takes a few minutes, after which the system will reboot and prompt you to log in as root using the new password.

Completed!


That’s it, the session was completed. 





































Comments

Popular posts from this blog

temp-1

  🔧 vast_id Configuration Key: vast_id Description This section defines the VAST ID , a unique numeric identifier used by internal systems for asset tracking, automation, or integration with enterprise management platforms. It helps associate the server with inventory records, monitoring tools, or deployment workflows. ✅ Used during provisioning to register the system in centralized databases or orchestration systems. JSON Format json 1 "vast_id" : 12194 ✅ Can also be provided as a string: json 1 "vast_id" : "12194" Field Reference vast_id String or Integer Unique identifier for the system in VAST (Verizon Asset Systems Tracker) 12194 ✅ Must be non-empty and numeric — leading zeros may be stripped depending on system. Validations Enforced vast_id  is required and must be a non-empty string or integer Ensures the field is present and contains usable data If  vast_id  is a string, it must not be blank or whitespace-only Prevents " " , "...

How to Generate and Use SSH Keys in OpenStack:

This guide walks you through generating SSH keys from scratch, configuring them in OpenStack, and using them for secure instance access. These steps will help you manage your OpenStack instances securely and efficiently using SSH key pairs.  Step-by-Step Guide: Generating and Using SSH Key Pairs in OpenStack:  Step 1: Generate SSH Key Pair Locally:  To begin, you need to generate an SSH key pair on your local machine. This pair consists of a public and a private key.  Generate a new SSH key pair on your local system (Linux/macOS). Run the following command in your terminal: # ssh-keygen -t rsa -b 2048 Enter the file name for the key: When prompted, provide the file name and path to save the key. By default, it will be saved in ~/.ssh/id_rsa . You can press Enter to accept the default location.  Set a passphrase (optional): You can choose to set a passphrase for additional security or leave it blank for easy access.  This will create two files: id_rsa:...

Install Apache Guacamole on Ubuntu 22.04

  Install Apache Guacamole on Ubuntu 22.04 Apache Guacamole Installation Guide Remote Desktop Gateway for Ubuntu 22.04 Ubuntu 22.04 Remote Desktop What is Apache Guacamole? Apache Guacamole is a clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH. Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser. Clientless No plugins or client software needed Secure ...