[1] boot from cdrom
ok boot cdrom -s
[2] mount root partition read/write on /a
# mount /dev/dsk/c0t0d0s0 /a
[3] set TERM
# TERM=vt100
[4] vi /a/etc/shadow
Here, delete the root passwd hash (not the whole line. just the hash)
And, save the file.
[5] Unmount root partition
# umount /a
[6] reboot from root disk to single-user mode. safety first
# reboot -- -s
[7] Hit <enter> when prompted for root password
[8] Once you get a shell, set root password
# passwd
[9] Reboot to go back to your default run-level/milestone