Root password reset

Reset root password
Ubuntu/Debian

in grub while booting pres E (edit)
find a line starting with linux
add: init=/bin/bash to the end of line
press control+X or B
boot system again

you become root in single user mod, with read only /
remount disks with:
mount -o remount,rw /

CentOS
in grub while booting pres E (edit)
find a line starting with linux

add rw init=/sysroot/bin/sh
cotrol+x

remount disks
mount -o remount,rw /

and chroot into directory
chroot /sysroot
change password
passwd root
Then appease SE Linux:
touch /.autorelabel

Reboot