TIMTOWTDI - there is more than one way to do it
here's another way for when you know the system is still OK but you didn't arrive
with boot/rescue disc in hand:
1. boot with parameter "init=/bin/bash"
2. the disks will be mounted read-only (ready for fsck), so remount the ones
you need to write to as read-write.
( for me, it's: "mount -o remount,rw /dev/sda2 /" )
3. change any account pwd you want: "passwd root" or "passwd user12"
4. "sync" ( for purists, it's: "sync;sync;sync" )
5. CTRL-ALT-DEL
done! 8)