- We can recover the root password for any solaris10 without any CD/DVD, for that first we need to bring the server at OK promt
#init 0
- Boot the server into failsafe mode. In failsafe mode, server will boot with RAM disk without any CD/DVD
Ok>boot
-F failsafe
#df
-k
/ramdisk-root:a 201463
178943 2374 99% / > Server booted from RAM
Note: Sometimes (every
time is X-86 servers) the Failsafe mode will ask you to mount the root disk
before giving you the Shell prompt. Do not mount at that time, just say No
everywhere and bring the failsafe mode at Shell Prompt and then do the mount
and update archive manually.
- In failsafe mode, we need to mount the server with root disk. Here my root disk c1t1d0s0
#mount
/dev/dsk/c1t1d0s0 /a
#df
-h|grep /a
/dev/dsk/c1t1d0s0
7.9G 7.1G 714M 92% /a
- Copy the configuration to enable SVM module in failsafe mode, and un mount root FS
# cp
/a/kernel/drv/md.conf /kernel/drv
#umount
/a
- Now we have to load the SVM module to enable it in failsafe mode:
#update_drv
-f md
devfsadm: mkdir
failed for /dev 0x1ed: Read-only file system
ßYou will see this messages
- Now you will be able to mount the md meta devices and will be able to make any changes
#mount
/dev/md/dsk/d0 /a
- Take a copy of /a/etc/passwd & /a/etc/shadow file
# cp -p /a/etc/passwd /a/etc/passwd-orig
# cp -p /a/etc/shadow /a/etc/shadow-orig
# cp -p /a/etc/shadow /a/etc/shadow-orig
- Need to remove encrypted passwd for root from /etc/shadow file
#grep root /a/etc/shadow
root:WP7grKsEFAgt.:15182::::::
root:WP7grKsEFAgt.:15182::::::
#grep root /a/etc/shadow
root::15182::::::
root::15182::::::
- Update the boot archive as below before proceeding with the reboot.
#bootadm update-archive -R /a
Creating
boot_archive for /a
updating /a/platform/sun4u/boot_archive
updating /a/platform/sun4u/boot_archive
- Umount the meta device and Reboot your system, this time you are allowed to login into the server without password. Now first recommended thing would be to set you password for root.
#umount /a
#init 6
Note:
The procedure for Solaris X-86 is also same, In X-86 select the Failsafe mode
from GRUB Menu which is present in the GRUB menu bydefault. The GRUB is picking
the entry from /boot/grub/menu.lst.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.