vcenter忘记密码修改 2024-06-25 虚拟化 暂无评论 1153 次阅读 #Process to Reset the Root Password in VCSA: Note: 6.7U1 and later has a simpler method to reset the password, see How to reset the lost or forgotten root password in vCenter Server Appliance 6.7 U1 and later https://kb.vmware.com/s/article/75174 To reset the root password for the vCenter Server Appliance: 1.Take a snapshot or backup of the vCenter Server Appliance before proceeding. Caution: Do not skip this step Note: If the vCenter Appliance is on the same ESXi hosts it manages. Connect directly to the ESXi host that it is located on to perform these steps. 2.Reboot the vCenter Server Appliance. 3.After the VCSA Photon OS starts, press the e key to enter the GNU GRUB Edit Menu. 4.Locate the line that begins with the word Linux. 5.Append these entries to the end of the line: ``` rw init=/bin/bash ``` The line should look like the following screenshot: ![get_attachment_content.png](https://blog.moper.net/usr/uploads/2024/06/804095612.png) `Reset root password in VCSA - rw init=/bin/bash` 6.Press F10 to continue booting. 7.Run the command ``` mount -o remount,rw / ``` 8.Unlock the 'root' account using below command if it is already locked due to multiple logins with incorrect password ``` pam_tally2 --user=root --reset ``` For 8.0 U2 onwards: ``` /usr/sbin/faillock --user root --reset ``` Note: pam_tally2 is deprecated in Photon 4, use faillock instead. 9.In the Command prompt, enter the command passwd and provide a new root password (twice for confirmation): ``` passwd ``` 10.Unmount the filesystem by running this command (yes, the unmount command is umount - it's not a spelling error): ``` umount / ``` 11.Reboot the vCenter Server Appliance by running this command: ``` reboot -f ``` 12.Confirm that you can access the vCenter Server Appliance using the new root password. 13.Remove the snapshot taken in Step 1 if applicable. 14.You could set the Root password to never expire in order to prevent this issue by running command: ``` # chage -I -1 -m 0 -M 99999 -E -1 root or at the VAMI ( https://:5480) ``` Note: If you continue to have issues, see Unable to log in to the vCenter Server Appliance shell using root account even after password reset https://kb.vmware.com/s/article/50113586 https://kb.vmware.com/s/article/2147144 https://knowledge.broadcom.com/external/article?legacyId=2147144 标签: vcenter 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。