Reset forgotten vsphere root /esxi password: Difference between revisions
No edit summary |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Tested using vSphere version 5.5. | |||
1. Download Gparted and create a bootable usb or mount the ISO file via the iLO/iDrac. | 1. Download Gparted and create a bootable usb or mount the ISO file via the iLO/iDrac. | ||
2. Once in Gparted you need to look for two 250MB paritions, shown below: | 2. Once in Gparted you need to look for two 250MB paritions, shown below: | ||
[[File:partition.png]] | |||
[[File:partition.png|500px]] | |||
3. Open a terminal window and type the following commands: | |||
<pre> | |||
sudo su | |||
mkdir /boot /temp | |||
mount /dev/sda5 /boot | |||
cd /boot | |||
cp state.tgz /temp | |||
cd /temp | |||
tar -xf state.tgz | |||
tar -xf local.tgz | |||
rm *.tgz | |||
cd etc | |||
</pre> | |||
4. Now we need to edit the shadow file and remote the password. Use vi or nano to open shadow: | |||
<pre>vi shadow</pre> | |||
or | |||
<pre> nano shadow</pre> | |||
5. You will then see a file similar to below, you want to remove the data between the first two colons for root: | |||
Before: | |||
<pre style="color: silver; background: black; width: 1000px"> | |||
root:$6$lYBB36Wx$UfYqNo0g&63hdOMRgNoJHFjAMa.s5hhf05nWVHgtus85FkPIzcFV.KJAOgog9NbEu85SmAIF/SaR8VIQb8b1:13358:0:99999:7::: | |||
nobody:*:13358:0:99999:7::: | |||
nfsnobody:!!:13358:0:99999:7::: | |||
dcui:*:13358:0:99999:7::: | |||
daemon:*:13358:0:99999:7::: | |||
vpxuser$$mGF4FrgiwOECIlL$uZjJ2PXuRfIRMveg.GYWC.G3KBsyStFv4.1Q97JU6w3cbpBo3.D3cjiDkk1/XcD/3qjp7q/QOzeBSo94KTVn.:18257:0:99999:7::: | |||
</pre> | |||
After: | |||
<pre style="color: silver; background: black; width: 1000px"> | |||
root::13358:0:99999:7::: | |||
nobody:*:13358:0:99999:7::: | |||
nfsnobody:!!:13358:0:99999:7::: | |||
dcui:*:13358:0:99999:7::: | |||
daemon:*:13358:0:99999:7::: | |||
vpxuser:$6$mGF4FrgiwOECIlL$uZjJ2PXuRfIRMveg.GYWC.G3KBsyStFv4.1Q97JU6w3cbpBo3.D3cjiDkk1/XcD/3qjp7q/QOzeBSo94KTVn.:18257:0:99999:7::: | |||
</pre> | |||
6. Save and exit | |||
7. Now run the following commands: | |||
<pre> | |||
cd .. | |||
tar -cf local.tgz etc/ | |||
tar -cf state.tgz local.tgz | |||
mv state.tgz /boot | |||
umount /boot | |||
reboot | |||
</pre> | |||
8. Boot back in to Gparted and follow steps 3-7 for the other parition. | |||
9. Once rebooted and back in vSphere DCUI you should be able to log in with username root and a blank password. You can then go in and set the password you require. | |||
Line 11: | Line 76: | ||
[[Category:esxi]] | [[Category:esxi]] | ||
[[Category:vcenter]] | [[Category:vcenter]] | ||
<comments /> |
Latest revision as of 09:06, 20 March 2022
Tested using vSphere version 5.5.
1. Download Gparted and create a bootable usb or mount the ISO file via the iLO/iDrac.
2. Once in Gparted you need to look for two 250MB paritions, shown below:
3. Open a terminal window and type the following commands:
sudo su mkdir /boot /temp mount /dev/sda5 /boot cd /boot cp state.tgz /temp cd /temp tar -xf state.tgz tar -xf local.tgz rm *.tgz cd etc
4. Now we need to edit the shadow file and remote the password. Use vi or nano to open shadow:
vi shadow
or
nano shadow
5. You will then see a file similar to below, you want to remove the data between the first two colons for root:
Before:
root:$6$lYBB36Wx$UfYqNo0g&63hdOMRgNoJHFjAMa.s5hhf05nWVHgtus85FkPIzcFV.KJAOgog9NbEu85SmAIF/SaR8VIQb8b1:13358:0:99999:7::: nobody:*:13358:0:99999:7::: nfsnobody:!!:13358:0:99999:7::: dcui:*:13358:0:99999:7::: daemon:*:13358:0:99999:7::: vpxuser$$mGF4FrgiwOECIlL$uZjJ2PXuRfIRMveg.GYWC.G3KBsyStFv4.1Q97JU6w3cbpBo3.D3cjiDkk1/XcD/3qjp7q/QOzeBSo94KTVn.:18257:0:99999:7:::
After:
root::13358:0:99999:7::: nobody:*:13358:0:99999:7::: nfsnobody:!!:13358:0:99999:7::: dcui:*:13358:0:99999:7::: daemon:*:13358:0:99999:7::: vpxuser:$6$mGF4FrgiwOECIlL$uZjJ2PXuRfIRMveg.GYWC.G3KBsyStFv4.1Q97JU6w3cbpBo3.D3cjiDkk1/XcD/3qjp7q/QOzeBSo94KTVn.:18257:0:99999:7:::
6. Save and exit
7. Now run the following commands:
cd .. tar -cf local.tgz etc/ tar -cf state.tgz local.tgz mv state.tgz /boot umount /boot reboot
8. Boot back in to Gparted and follow steps 3-7 for the other parition.
9. Once rebooted and back in vSphere DCUI you should be able to log in with username root and a blank password. You can then go in and set the password you require. <comments />