Boot from the cdrom in single user mode by doing the following:
hit the -A keyboard sequence
put the cd in the cdrom drive
you will see a prompt that says "ok"
type:
boot cdrom -s
This will boot from the cdrom drive to the single user mode without making you type in a password.
once you are in the single user mode, you will have to find out what drive/partition your root file system is located on. I would guess that it would be /dev/dsk/c0t0d0s0, but it could be any number of drive/slice combinations. I would recommend using the "format" command to see what drives you have, and what the partition layout is for them.
once you have a guess at what the drive and slice numbers are, you should mount them using the following command:
mount -F ufs /dev/dsk/c#t#d#s# (I would try /dev/dsk/c0t0d0s0 first as that is usually pretty standard).
if that mounts cleanly, check to see if there is an etc directory in the filesystem by doing an ls on /mnt. if etc exists in there, you will have to edit the /mnt/etc/shadow file.