What To Do If You Forgot Root Password
What To Do If You Forgot Root Password
If you forget the root password and you cannot log into the system, you will have to do the
following:
These procedures are fully described in Booting a SPARC Based System in System
Administration Guide: Basic Administration , Booting a System in the GRUB Based Boot
Environment in System Administration Guide: Basic Administration , and Booting an x86 Based
System in System Administration Guide: Basic Administration .
Note
GRUB based booting is not available on SPARC based systems in this Solaris release.
The following examples describe how to recover from a forgotten root password on both SPARC
and x86 based systems.
The following example shows how to recover when you forget the root password by booting
from the network. This example assumes that the boot server is already available. Be sure to
apply a new root password after the system has rebooted.
Example 25.2. Performing a GRUB Based Boot When You Have Forgotten the Root
Password
Solaris Express 6/05: This example assumes that the boot server is already available. Be sure to
apply a new root password after the system has rebooted.
+-------------------------------------------------------------------------+
| Solaris 10.1 nv_14 X86 |
| Solaris failsafe |
| |
| |
| |
+-------------------------------------------------------------------------+
+-------------------------------------------------------------------------+
| root (hd0,2,a) |
| kernel /boot/multiboot -B console=ttya kernel/unix -s |
| module /boot/x86.miniroot-safe |
| |
| |
| |
+-------------------------------------------------------------------------+
Booting command-list
root (hd0,2,a)
Filesystem type is ufs, partition type 0x000000bf
kernel /boot/multiboot -B console=ttya kernel/unix -s
[Multiboot-elf, <0x1000000:0x13f3b:0x3941d>, shtab=0x104e258, entry=0x100000
0]...
module /boot/x86.miniroot-safe
SunOS Release 5.10.1 Version snv_14 32-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Booting to milestone "milestone/single-user:default".
Configuring devices.
Searching for installed OS...
/dev/dsk/c1t0d0s0 -- Solaris 10.1 nv_14 X86
#mount /dev/dsk/c0t0d0s0 /a
.
.
.
# cd /a/etc
# vi shadow
(Remove root's encrypted password string)
# cd /
# umount /a
# init 6
Example 25.3. Booting a System When You Have Forgotten the Root Password
Solaris 10: The following example shows how to recover when you forget root's password by
booting from the network. This example assumes that the boot server is already available. Be
sure to apply a new root password after the system has rebooted.