To reset forgotten password hard reboot your affected VM or bare metal server, press arrow key to skip boot timeout from grub, then press “e”
search for line start with “linuxefi” (some time instead of “linuxefi” you can find “linux” or “linux16”) and press “end” button
at the end of the line type init=/bin/bash then press F10 or ctrl+x to boot
now you can will be booted into shell, but it will in readonly mode, to change to read, write mode type following commands
mount -o rw, remount /
after that type
to reset password type following command followed by user name.
then type exit and