vSphere 6.5 Component Password Recovery (vCenter, SSO and ESXi)

简介:

Everyone knows the situation where you can't log into a system because you have forgotten the password. The following article explains how to reset the password and regain access to VMware vSphere 6.5 core components including vCenter, SSO and ESXi Hosts.

  • Reset vCenter Server Appliance 6.5 root password

  • Reset SSO Administrator Password (vCenter Server Appliance 6.5)

  • Reset ESXi root password with Host Profiles

  • Gain Administrative ESXi access with an Active Directory

  • Reset ESXi root password (Linux Live CD)

Reset vCenter Server Appliance 6.5 root password

The following method provides steps to recover the vCenter Server Appliance (vCSA) root password. The process is slightly different compared to previous versions as the OS has been changed to PhotonOS. The method is officially supported by VMware and documented in KB2147144.

  1. Take a snapshot of the vCSA to be able to rollback in case of any problems during password recovery.

  2. Connect to the ESXi Host that runs the vCSA and open a remote console.

  3. Reboot the vCSA

  4. Press e immediately after the system starts (When the PhotonOS screen shows up)

  5. Append rw init=/bin/bash to the line starting with linux
    vcsa-65-password-recovery-grub.png

  6. Press F10 to boot

  7. In the command prompt, enter passwd and enter a new root password twice

  8. Enter umount / to unmount the root filesystem

  9. Reboot the vCSA by running the command reboot -f

  10. Verify that you can log in with the new root password and delete the snapshot created in step 1.

 

Reset SSO Administrator Password (vCenter Server Appliance 6.5)

The following method provides steps to recover the SSO administrator password on a vCenter Server Appliance (vCSA). The method is officially supported by VMware and documented in KB2146224.

  1. Log in to the vCSA using SSH as root

  2. Enter shell to start the bash shell

  3. Identify the SSO Domain Name (Default is vsphere.local)

    # /usr/lib/vmware-vmafd/bin/vmafd-cli get-domain-name --server-name localhost

    vcsa-identify-sso-domain-name.png

  4. Start the vdcadmintool


    # /usr/lib/vmware-vmdir/bin/vdcadmintool
  5. Press 3 (Reset account password)

  6. The tool asks for the Account UPN to reset. Enter Administrator@<DOMAIN> (identified in Step 3)

  7. The tool generates and displays a new password.

  8. Use the password to log in with the vSphere Web Client and change the password.

 

Reset ESXi root password with Host Profiles

According to VMware KB1317898, "reinstalling the ESXi host is the only supported way to reset a password on ESXi". However, there is a loophole as you can set the root password with Host Profiles under certain conditions. This method has two requirements:

  • The ESXi hosts needs to be managed by a vCenter

  • vSphere Enterprise Plus License is required to use Host Profiles

The vCenter uses a vpxuser to communicate with ESXi hosts, so it does not depend on the root account. As long as the ESXi host is managed by the vCenter, you can change the configuration without knowing the ESXi root password. This method works with all ESXi 5.x and 6.x versions.

  1. Create a Host Profile with the ESXi you want to reset the root password as reference Host
    Web Client > Right-Click the ESXi Host > Host Profiles > Extract Host Profile...

  2. Navigate to the Host Profile and select Actions > Edit Settings...

  3. Navigate to the root User Configuration
    Security and Services > Security Settings > Security > User Configuration > root

  4. Set the Password configuration to Fixed password configuration and enter a new password.

  5. Click Finish to close the profile configuration

  6. Right-Click the Host Profile and select Attach/Detach Hosts and Clusters...

  7. Highlight the ESXi host, Click Attach > and finish the configuration screen

  8. Put the ESXi host into maintenance mode

  9. Right-Click the ESXi host and select Host Profiles > Remediate...

  10. Finish the remediation wizard. The remediation should take less than a minute, no reboot is required.

  11. Use the new root password to login

 

Gain Administrative ESXi access with an Active Directory

When you don't have the Enterprise Plus license, you can join an Active Directory to regain administrative access to the ESXi host. This method circumvents the limitation that root PW recovery is not supported.

  1. Login to the vCenter with the vSphere Web Client

  2. Navigate to ESXi > Configure > System > Authentication Services

  3. Click Join Domain...

  4. Enter the domain name and user credentials

  5. Click OK

  6. In the ESXi configuration, open System > Advanced System Settings

  7. Enter Config.HostAgent.plugins.hostsvc.esxAdminsGroup in the search field

  8. Change the settings to match the Administrator group that you want to use in the Active Directory. You can either create a new group in your direcotry or enter an existing group

 

Reset ESXi root password (Linux Live CD)

When you need to recover root access and the methods above are not applicable, the last method explains how to reset the root password with a Linux Live CD. Please be aware that this method is not supported by VMware as KB1317898 states: "reinstalling the ESXi host is the only supported way to reset a password on ESXi". You can use any current Linux Live CD or installer CD that has a recovery mode. In this example I'm using Knoppix.

  1. Shutdown the ESXi host

  2. Boot the system with the Linux Live CD

  3. Make sure that you can read the gpt partition table, for example with parted /dev/sda print

  4. We are looking for the first fat16 partition with a size of 262MB. IT should be number 5.

  5. Mount the partition

    # mount /dev/sda5 /media/sda5
  6. Verify that there is a current state.tgz in the directory.

  7. # ls -l /media/sda5/state.tgz

  8. The state.tgz file contains the local.tgz file which contains the configuration. Extract both to a temporary directory.

    # cd /tmp/
    # cp /media/sda5/state.tgz /tmp/state.tgz
    # tar -xf state.tgz
    # tar -xf local.tgz
  9. Edit the shadow file and remove the root password

    # vi etc/shadow

    Remove the hashed password until the second colon:

    You want a file that looks like this:

  10. Save the file and exit the editor (<ESC> :wq <ENTER>)

  11. Recreate state.tgz with the changed shadow file

    # tar -czf local.tgz etc
    # tar -czf state.tgz local.tgz
  12. Move state.tgz back to ESXi partition and make sure to overwrite the old file

    # mv state.tgz /media/sda5/
  13. Reboot to ESXi. You should be able to access the DCUI or log in as root without a password.

本文转自学海无涯博客51CTO博客,原文链接http://blog.51cto.com/549687/1936639如需转载请自行联系原作者
520feng2007

相关文章
|
XML 存储 分布式数据库
数据库主流技术
数据库主流技术
380 4
|
人工智能 自然语言处理 IDE
通义灵码_智能编码助手_AI编程——程序员必备编程利器!
*通义灵码是阿里云的AI编程助手,提供代码智能生成、研发问答等功能,如实时续写、自然语言转代码、单元测试、优化、注释生成等。支持多种编程语言,IDE包括JetBrains、VS Code和VS 2022。优势包括跨文件感知、阿里云服务优化、多IDE集成、研发问答和双模引擎。个人基础版免费,专业版现限时免费,企业版有不同的定价和服务。
3643 0
|
数据采集 领域建模 数据库
领域模型图(数据架构/ER图)
数据架构重要的输出是数据-实体关系图,简称 ER 图。ER 图中包含了实体(数据对象)、关系和属性 3 种基本成分。ER 图可以用来建立数据模型。如何准确的建立产品的数据模型,需要分解出业务需要什么样的数据。数据域的分解过程是站在业务架构的基础上,对业务域进行模型分析的过程。
1155 0
|
1天前
|
数据采集 人工智能 安全
|
10天前
|
云安全 监控 安全
|
2天前
|
自然语言处理 API
万相 Wan2.6 全新升级发布!人人都能当导演的时代来了
通义万相2.6全新升级,支持文生图、图生视频、文生视频,打造电影级创作体验。智能分镜、角色扮演、音画同步,让创意一键成片,大众也能轻松制作高质量短视频。
910 150
|
15天前
|
机器学习/深度学习 人工智能 自然语言处理
Z-Image:冲击体验上限的下一代图像生成模型
通义实验室推出全新文生图模型Z-Image,以6B参数实现“快、稳、轻、准”突破。Turbo版本仅需8步亚秒级生成,支持16GB显存设备,中英双语理解与文字渲染尤为出色,真实感和美学表现媲美国际顶尖模型,被誉为“最值得关注的开源生图模型之一”。
1646 8
|
6天前
|
人工智能 前端开发 文件存储
星哥带你玩飞牛NAS-12:开源笔记的进化之路,效率玩家的新选择
星哥带你玩转飞牛NAS,部署开源笔记TriliumNext!支持树状知识库、多端同步、AI摘要与代码高亮,数据自主可控,打造个人“第二大脑”。高效玩家的新选择,轻松搭建专属知识管理体系。
365 152
|
7天前
|
人工智能 自然语言处理 API
一句话生成拓扑图!AI+Draw.io 封神开源组合,工具让你的效率爆炸
一句话生成拓扑图!next-ai-draw-io 结合 AI 与 Draw.io,通过自然语言秒出架构图,支持私有部署、免费大模型接口,彻底解放生产力,绘图效率直接爆炸。
604 152