Reset forgotten root password in Redhat 7

Опубликовано: 13 Август 2026
на канале: Business Server Solutions
20,260
106

Red Hat Enterprise Linux 7: Reset forgotten root password.

This video tutorial is part of RHCSA Fast Track course.

Please use below cookbook to reset forgotten or unknown password in Red Hat Enterprise Linux, CentOS Linux, Scientific Linux, Oracle Linux and Fedora.

1) Reset Linux server if it is running
2) press e to edit default entry on grub bootloader menu
3) replace keyword "rhgb quiet" with init=/bin/bash
4) press CTRL + x to boot into root shell
5) remount / (root) filesystem with read write options
5.1) / (root) filesystem is mounted with ro (read-only options)
mount | grep -w "/"
5.2) remount / (root) filesystem with rw (read write) options
mount -o remount,rw /
5.3) doublecheck if / root filesystem has been remouted with rw (read-write) options
mount | grep -w "/"
6) Change root password
passwd
7) relabel SELinux context for entire root filesystem
Below command will ensure that the SELinux context for entire filesystem will be relabeled after reboot:
touch /.autorelabel
8) Continue boot process - run exec /sbin/init command
exec /sbin/init

Related Video Tutorials:
RHCSA Fast Track course:
Reset forgotten root password in Redhat 7:
   • Reset forgotten root password in Redhat 7  

Network Interface naming convention in Red Hat 7:
   • Network Interface naming convention in Red...  

Setting up network without NetworkManager in Redhat 7:
   • Setting up network without NetworkManager ...  

Setting up network using NetworkManager and network scripts in Redhat 7:
   • Setting up network using NetworkManager an...  

Setting up network using a NetworkManager text user interface (nmtui) in Red Hat 7 - EASY!!!
   • Setting up network using a NetworkManager ...  

Setting up network in Red Hat 7 in less than a minute - QUICK & EASY!!!
   • Setting up network in Red Hat 7 in less th...  

Setting up network using a NetworkManager command line interface (nmcli) in Red Hat 7
   • Setting up network using a NetworkManager ...  

nmcli cheat! Setting up network using nmcli in Red Hat 7 in less than a 30 seconds - QUICK & EASY!!!
   • nmcli cheat! Setting up network using nmcl...  

The Complete Beginners Guide to Linux Network Configuration - GUI & Easy!
   • Complete Beginners Guide to Linux Network ...  

Shrink ext2 ext3 and ext4 file system and reduce the size of a logical volume with only one command.
   • Shrink ext2 ext3 and ext4 file system and ...  

Complete guide to file system shrinking and reducing the size of the underlying logical volume.
   • Complete guide to file system shrinking an...