SlideShare a Scribd company logo
Howto Reset Root Passwords on RHEL 7 and CentOS 7 Linux Systems
If you have forgotten your root password on a Red Hat Enterprise Linux 7 server you can reset your root
password as long as you have access to the GRUB 2 bootloader. (The following example was performed
on a OL7 server)
press "e" to edit.
Find line beginning linux
Find the line beginning with linux. In this example the line begins linux16.
Using the arrow keys and the delete key, manually delete the following entries rhgb and quiet from the
line.
Next, in the end of the line add this init=/bin/sh
press the keys Ctrl +X to reboot
- Load the installed SELinux policy: /usr/sbin/load_policy -i
- Remount the "/" root filesystem in Read/Write mode: mount -o remount,rw /
- Using command passwd to change your new root password
- Remount the "/" root filesystem in Read Only mode: mount -o remount,ro /
- Using this command to reboot server
#exec /sbin/init 6

More Related Content

DOCX
it test4
PPT
Anandha ganesh linux1.ppt
DOCX
6 stages of linux boot process
PPTX
Linux Commands
PDF
Termux commands-list
PDF
[PDF] 2021 Termux basic commands list
DOCX
PPT
Linux presentation
it test4
Anandha ganesh linux1.ppt
6 stages of linux boot process
Linux Commands
Termux commands-list
[PDF] 2021 Termux basic commands list
Linux presentation

What's hot (19)

PPT
Power point on linux commands,appache,php,mysql,html,css,web 2.0
TXT
PPT
PDF
linux-commandline-magic-Joomla-World-Conference-2014
PPT
Basic command ppt
PDF
E mail setting in koha
PDF
11 unix osx_commands
PDF
Konfigurasi freeradius server
PPTX
Presentación1
PDF
Linux cheat-sheet
PDF
Linux command line cheatsheet
PPTX
SquirrelMail for webmail
PDF
Linux Bash Shell Cheat Sheet for Beginners
PDF
Unix command quickref
PDF
Command line for the beginner - Using the command line in developing for the...
DOCX
Basic linux commands
PDF
Unix Command-Line Cheat Sheet BTI2014
PPTX
Introduction to linux day-3
PDF
Openfire xmpp server on windows server 2012 r2 with spark sso
Power point on linux commands,appache,php,mysql,html,css,web 2.0
linux-commandline-magic-Joomla-World-Conference-2014
Basic command ppt
E mail setting in koha
11 unix osx_commands
Konfigurasi freeradius server
Presentación1
Linux cheat-sheet
Linux command line cheatsheet
SquirrelMail for webmail
Linux Bash Shell Cheat Sheet for Beginners
Unix command quickref
Command line for the beginner - Using the command line in developing for the...
Basic linux commands
Unix Command-Line Cheat Sheet BTI2014
Introduction to linux day-3
Openfire xmpp server on windows server 2012 r2 with spark sso
Ad

Similar to How to reset root passwords on rhel 7 and cent os 7 linux systems (20)

PPT
Unix Administration 2
PPTX
Building a linux kernel
DOCX
Rhel 7 root password reset
DOCX
6 stages of linux boot process
PDF
55 best linux tips, tricks and command lines
DOC
6 stages of linux boot process
PDF
Rhel7 cent os7-reset-root-password-v1
PPT
Linux
DOCX
6 stages of linux boot process
PPT
101 1.3 runlevels , shutdown, and reboot
PPT
101 1.2 boot the system
PDF
linux_Commads
PDF
OS_lab_file.pdf
PPTX
RPM (LINUX)
PDF
Samba
PDF
Ubuntu Practice and Configuration
PDF
Basic linux commands
PPT
Divya
PPT
Divya
PPTX
Linux Fundamentals - An Intro to Linux Fundamentals
Unix Administration 2
Building a linux kernel
Rhel 7 root password reset
6 stages of linux boot process
55 best linux tips, tricks and command lines
6 stages of linux boot process
Rhel7 cent os7-reset-root-password-v1
Linux
6 stages of linux boot process
101 1.3 runlevels , shutdown, and reboot
101 1.2 boot the system
linux_Commads
OS_lab_file.pdf
RPM (LINUX)
Samba
Ubuntu Practice and Configuration
Basic linux commands
Divya
Divya
Linux Fundamentals - An Intro to Linux Fundamentals
Ad

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PDF
KodekX | Application Modernization Development
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
MIND Revenue Release Quarter 2 2025 Press Release
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

How to reset root passwords on rhel 7 and cent os 7 linux systems

  • 1. Howto Reset Root Passwords on RHEL 7 and CentOS 7 Linux Systems If you have forgotten your root password on a Red Hat Enterprise Linux 7 server you can reset your root password as long as you have access to the GRUB 2 bootloader. (The following example was performed on a OL7 server) press "e" to edit. Find line beginning linux Find the line beginning with linux. In this example the line begins linux16.
  • 2. Using the arrow keys and the delete key, manually delete the following entries rhgb and quiet from the line. Next, in the end of the line add this init=/bin/sh press the keys Ctrl +X to reboot - Load the installed SELinux policy: /usr/sbin/load_policy -i - Remount the "/" root filesystem in Read/Write mode: mount -o remount,rw / - Using command passwd to change your new root password - Remount the "/" root filesystem in Read Only mode: mount -o remount,ro / - Using this command to reboot server #exec /sbin/init 6