Steps below will show how to reset root password in debian like machines.
1. Boot the machine and enter in GRUB menu.
2. Press e to go in edit mode.
3. Scroll down to the line starting with kernel.
4. Go to the end of the line and press space bar and type linux single.Press space bar again and type init=/bin/bash
5. Press ctrl X to boot.
6. After machine is booted.type below command.
mount -rw -o remount /
7. Type passwd command to change root password.
8. Reboot