Steps:
In GRUB selection screen, press ‘e’ to edit the first line
Debian GNU/Linux, kernel 2.4.27-2-386
press ‘e’ to edit the second line
BEFORE: kernel /boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro
AFTER : kernel /boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro init=/bin/bash
press ‘b’ to boot
mount -no remount,rw /
passwd root
reboot