Tanti Technology

My photo
Bangalore, karnataka, India
Sandeep Kumar | Founder, Tanti Technologies At Tanti Technologies, I share practical knowledge, hands-on tutorials, and real-world solutions across Python, SQL, Docker, Kubernetes, CI/CD, AWS, Azure, Machine Learning, Generative AI, and Agentic AI. My mission is to simplify complex technologies and provide actionable insights that help developers, engineers, and businesses learn faster, build better, automate smarter, and innovate with confidence. 🚀 Learn • Build • Automate • Innovate Follow Tanti Technologies for practical technology insights and next-generation AI solutions.

Monday, 28 April 2014

Lost Root Password Recovery Using NIM


On the nim server, configure the nim client for a maintenance boot:
# nim -o maint_boot -a spot=install
 image> <host machinename>
Boot the client into SMS and, after configuring the network settings, etc., boot the system normally into the ‘Welcome To Base OS’ menu.
You will now see an option to ‘Start Maintenance Mode for System Recovery’ (option 3).  Choose this option and then ‘Access this volume and Start a Shell’.  Select 0 Continue. If the shell is given successfully use the ‘passwd’ command to change the root password.
# passwd
# sync;sync;sync;reboot
This is how lost password recovery is supposed to work.  However, if you get an error about getrootfs failing, use the following technique:
Identify the rootvg hdisk with lspv, import the disk and mount / .
# lspv
# importvg hdisk(x)
# mount /dev/hd4 /mnt
Next, we’ll create a temporary user with root’s ID.
# echo temproot::0:0::/:/usr/bin/ksh >> /mnt/etc/passwd
# sync
# cd /
# umount /mnt
Reboot and login as ‘temproot’.  Change root’s password.
# passwd root
Lastly, and most importantly, edit the /etc/passwd file and REMOVE temproot.
Have a better way to handle this?  Let us know in the comments.

No comments:

Post a Comment