Solaris rescue cd to change forgotten root password

1) Boot off Device Configuration Assistant with
CD in.

2) When the install process gets to "choose type of installation"
1) Interactive
2) Jump Start
3) Web Start

type: boot cdrom -s
(or, if all you can do is get to the prom with stop-A or Ctrl-Break) type boot cdrom -s

3) When you get the root prompt you are in single user mode.

4) Create a mount point: # mkdir /mnt

5) Mount the root slice: # mount /dev/dsk/c0d0s0 /mnt
(or whatever the device is called).
5b) If the filesystem is corrupted, you may need to fsck /dev/rdsk/c0d0s0... before you can mount
(/dev/dsk/* for mount, /dev/rdsk/* for fsck. /etc/vfstab will tell you which device name to use.)
6) Set up TERM variable: # TERM=AT386;export TERM

7) Go to /etc/shadow and clear the password entry for root.
# vi /mnt/etc/shadow
e.g. root:sdfgsdSDGS3832:6445:::::: remove everything between the first two colons.

8) # sync;umount /mnt; sync;reboot

9) When the system comes back up you should be able to log in as root without a

10) Use # passwd to set a new password for root.

No comments: