How to reset the lost or forgotten root password in vCenter

VMware vCenter Server Appliance 6.5最大的改变,
就是作业系统运作在VMware自行开发、优化的新Photon OS v1.0系统上。

如不小心遗忘当初设定root的密码,在Photon OS v1.0系统上
要如何重新设置新root密码?才能恢复登入Photon OS v1.0系统
及VMware vSphere Appliance 6.5 Management管理介面,
来看看VMware官方实际解决方法:KB2147144说明。
http://img2.58codes.com/2024/201030195wcJtghjyB.png
PS.此方法只适用于新vCenter Server Appliance 6.5,不适用于以前VCSA6.0的版本。

学习主题
1.How to enter the GNU GRUB Edit Menu. 如何进入Photon OS系统编辑开机选单。
2.Enter the command passwd and provide a new root password.变更root密码。

实作说明
Login VMware vSphere Appliance 6.5 Management unable to authenticate.
开启浏览器,请输入:https://VCSA FQDN or IP Address:5480
登入帐号:root
登入密码:
忘了当初设定密码时,结果输入老半天就是无法登入、密码认证失败。
http://img2.58codes.com/2024/201030196fKMz4bOjW.png

Account locked due to 6 failed logins 尝试直接登入系统也失败....
http://img2.58codes.com/2024/20103019zMf9GQ4Eih.png

1.Take a snapshot or backup of the vCenter Server Appliance 6.5 before proceeding.
Do not skip this step.
开启浏览器登入ESXi 6.5a Host Client,
请先对VCSA6.5系统快照备份(有备无患不怕改失败)
网址请输入:https://ESXi Server IP or FQDN/ui
登入帐号:root
登入密码:系统安装时,所设定输入密码。
Select点选:Navigator导览器➤Virtual Machines虚拟机器➤VCSA6.5
➤Right-click the Snapshots快照➤Take snapshot建立快照
http://img2.58codes.com/2024/20103019l60Pl6MTrf.png

请点选:Take snapshot建立快照(请输入Name快照名称与Description说明)
http://img2.58codes.com/2024/20103019Zlr76lH3dp.png

2.Reboot the vCenter Server Appliance 6.5.重新启动VCSA6.5系统
Select点选:Navigator导览器➤Virtual Machines虚拟机器➤VCSA6.5
➤Right-click the Guest OS客体作业系统➤Restart重新启动
http://img2.58codes.com/2024/20103019f1xkbSc7ZW.png

3.After the OS starts, press "E" key to enter the GNU GRUB Edit Menu.
系统重新启动后,按键盘按键:E进入GNU GRUB开机程式编辑选单。
http://img2.58codes.com/2024/20103019Dy8hqX9OsN.png

4.找到以Linux一词开头行字元
5.Append these entries to the end of the line: 在最后一行空格输入:
rw init=/bin/bash
(如下图所示 )
http://img2.58codes.com/2024/20103019za6tdTTDym.png

6.Press F10 to continue booting.请按F10继续开机

7.In the Command prompt, enter the command passwd
and provide a new root password(twice for confirmation):
在命令提示字元下,输入指令,提供一个新的root密码(两次确认)
passwd
http://img2.58codes.com/2024/201030196mIUGrqaKG.png

PS.密码至少 8 个字元,不超过 20 个字元,至少有1个大写字元、
至少有1个小写字元、至少有1个数字、至少有1个特殊字元。

8.Unmount the file system by running this command.
执行指令卸载档案系统,恢复下次正常开机程序:
umount /

9.Reboot the vCenter Server Appliance 6.5 by running this command.
执行以下指令重新开机:
reboot -f

10.Confirm that you can access the VMware vSphere Appliance 6.5 Management
using the new root password
开启浏览器,登入VMware vSphere Appliance 6.5 Management管理介面
请输入:https://VCSA FQDN or IP Address:5480
登入帐号:root
登入密码:输入新变更密码,就可以正常登入系统。
http://img2.58codes.com/2024/20103019BlKhF9W9rr.png
直接登入系统操作也正常:
http://img2.58codes.com/2024/20103019nCdSB3fiCd.png

11.Remove the snapshot taken in Step 1 if applicable.
请记得移除步骤1建立的VCSA6.5快照。

结语
Password it is too simplistic
变更新密码记得不可以设定得太简单,会如下图root密码变更是不会成功的。
http://img2.58codes.com/2024/20103019qRk61FZsSI.png
密码至少 8 个字元,不超过 20 个字元,至少有1个大写字元、至少有1个小写字元
至少有1个数字、至少有1个特殊字元。

VCSA6.5 Password must conform to the following:
http://img2.58codes.com/2024/20103019gjtEcSmQt5.png

Reference 参考资料:KB2147144
1.How to reset the lost or forgotten root password in vCenter Server Appliance 6.5

本文完整章节发布于:Lab-VM Testing Blog


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章