In this article, I will show you the server I used recently and forgot the password. I used Centos7 as the operating system.
First off, let’s shut down our server. Then, at the bottom of the opening screen, ”
Press ‘e’ to edit the selected item or ‘c’ for a command prompt.” Let’s look at the part.
Let’s press ‘
e’ ıp and continue.
Let’s go down with the arrow directions on the screen and find the relevant line.
ro part you see on the screen (
linux16 / vmlinuz the end of the line)
rw init = / sysroot / bin / sh and change it. It then exit this section with the
Ctrl + x key combination.
In this screen;
you can enter your new password…”
Finally, due to
selinux settings, you should enter the following command. In this way, the new password will be active-tagged. At the command prompt, commands such as reboot-shutdown will not work. Don’t forget to exit chroot.
I hope it has been a useful article.