How To Reset Root Password On CentOS7 and RHEL7

Windows Articles

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
Avatar
Mel Khamlichi
Webmaster and technical Director at Osradar.com Linux/Unix Guru Technology and hardware addicted Location : Amsterdam Netherlands

One of the worst cases in Linux is when you forget your root password and you have no  users with  root sudo privileges to recover the admin password. let me tel you that can be happen even in the big IT companies .

No worry, there is always a solution to reset new password for your Server.

1-Boot menu

On the Grub boor menu , please select last kenel installed, and press  <e>  to Edit

2- Change boot Settings :

Please find line starting with linux16 and find  string ro

3- change  ro to  rw init=/sysroot/bin/sh.

 

4-Control+X to start machine in Emergency Shell

5 – Switch into a chroot jail, where /sysroot is treated as the root of the filesystem tree

chroot /sysroot
6 –Now you can Reset the password.
passwd root
7 – Update selinux information to make this permanent
touch /.autorelabel
8 – Exit chroot
exit

9 – Reboot your system with command reboot

reboot
10- Enjoy the New password :

Cheers!!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
x