Root Password Lost !!!

I've forgotten root password on one of Solaris machines, i searched in forumes to find a similar case but there's no proceudre here to reinintialize root password, cause most of related commands & even single user mode needs root password that i don't have.
Any solution would be helpful.
--rgrds,
nikk

I'm pretty sure if you boot into single user mode from the CD then that should help you.

Boot to single user mode and recover it from there.

See this

You need to use:

 a\) A console, or

 connect a PC/notebook in the serial port using the apropiate serial cable:

      1\) If the Serial console use an RJ45 as Serial conector
                use the cable provided with the machine, or
                if you use cisco switches use the terminal DB9 
                \(for the PC an the cisco cable to serial 1\)
       2\) If the Serial console use an DB25 connector as 
               Serial conector use the cable provided with the 
               machine, or an HP Serial cable DB9 to DB25

Because the most common case is to use a serial connection
the rest of the post is

   b\) Open an Hyperterminal/SecureCRT or whatever and
        open a connection via COM1 \(9600-8-N-1-None\) using vt100
        emulation.

   c\) Send a shift-break to halt the system 

   d\) at the ok prompt
          OK boot cdrom -s

    e\) After boot
         TERM=vt100
         export TERM
         mkdir /tmp/d0
         mount /dev/dsk/c0t0d0s0 /tmp/d0   
         cd /tmp/d0/etc
         
     f\) Leave blank the second field of the /etc/passwd
        vi /tmp/d0/etc/passwd
       \( delete the x an save :wq! \)

     g\) reboot

      h\) when prompt for root passwd press enter

      i\) change root passwd
              passwd.

Note: If possible that you need to run an fsck
example: fsck -F <FSTYPE> -y /dev/rdsk/c0t0d0s0
FSTYPE: usually ufs

Note 2: If you use Solstice Disksuite in order to mirror
boot disk, you need to copy the modified /etc/passwd
to the other partition. I.E.:

f.1) mkdir /tmp/d1
mount /dev/dsk/c0t1d0s0 /tmp/d1
cp -p /tmp/d0/etc/passwd /tmp/d1/etc/passwd

On with solaris level are you working on.

Since version 2.6 solaris ask you for enter the root password when you boot single user, so this will not help you.

the only way, as far i see is to boot from cdrom.
stop the installation fase and mount the root-file-system.
make a copy of the password file, reset the password field in the password file for user root.

reboot your system, set the password again.

I have a box with Solaris 2.6 that work different,
never prompt for root password when I boot
from the boot prompt with boot cdrom -s.

The only password that I supply in same boxes
are the Firmware password if it's established.

Regards. Hugo

there can be a difference between booting single user from CD-ROM or from harddisk.

But, I suppose that all the people know that, (FS / in NVRAM,
the only FS with write permissions is TMP, and so on).

When Merlin says:

"... single user mode from the CD ..." (i.e: boot cdrom -s )

or when I explain with more detaills the proccess that Merlin has
proposed, all are talking the same.

When you boot from cdrom with the flag -s,  is not

necessary to interrupt the installation proccess; because
the -s flag avoids the installation.

------------------------------------------------------------------------
nikk:

If the server is an Enterprise E 420R you need to use
the CD :
"Operating Environment Installation CD P.N: 704-7076-10"
Don't use the CD:
"Solaris 2.6 Software"
or you will need to change the environment to do this.

-------------------------------------------------------------------------
janr:

Please, be carefull when you use non standard procedures.

------------------------------------------------------------------------

Regards. Hugo.

The system is Ultra SparcII ,anyway i did booting from CD in single user mode & it worked, thanks everyone Spc. Hugo.
Rgrds,
Nikk