How to reset password in Rocky/Alma Linux?
Step 1 First, you need to reboot the system. On the first entry of the grub menu, Press “e” on the keyboard to access the GRUB editor.
#rd.break enforcing=0 ##Add this command
Step 2 Press ctrl+x to start the linux server on the Grub Environment
# mount -o rw,remount /sysroot
#chroot /sysroot
#passwd root # #create a root new password
#touch /.autorelabel ##Selinux
#exit
#exit
Step 3 Now, reboot your Linux Server automatically.
Step 4 Use this current created password to login on your system.