热门搜索:11 11 360 微信 鲁大师 我的
您的位置:首页 > 文章资讯 > 网络技术
VMware vSphere ESXI忘记密码怎么重置?
作者: | 更新时间:2024-02-29 15:51:11 | 来源:本站整理 | 阅读次数:
官方建议:在KB中提到ESXi 3.5, ESXi 4.x, ESXi 5.x and ESXi 6.x
Reinstalling the ESXi host is the only supported way to reset a password on ESXi. Any other method may lead to a host failure or an unsupported configuration due to the complex nature of the ESXi archi

方法一:

官方建议:在KB中提到ESXi 3.5, ESXi 4.x, ESXi 5.x and ESXi 6.x
Reinstalling the ESXi host is the only supported way to reset a password on ESXi. Any other method may lead to a host failure or an unsupported configuration due to the complex nature of the ESXi architecture. ESXi does not have a service console and as such traditional Linux methods of resetting a password, such as single-user mode从3.5/4.x/5.x/6.x开始,只支持重新安装来重置密码.

方法二:

准备工作:使用Linux镜像(centos,Redhat等)制作一个启动盘。
实验环境:此次的实验环境没有硬件主机,是基于VMware workstation的虚拟机实现,esxi主机的版本为6.7版本,使用的Linux镜像CentOS 1908版本。

==============================

1、
开机之后进入启动盘,按照下图所示的步骤进入centos的救援模式



======>



======>



======>



==============================
2、
然后按照一下步骤进行密码修改
mkdir /mnt/disk
mount /dev/sda5 /mnt/disk
cd /mnt/disk
ls


==============================
3、
cp /mnt/disk/state.tgz /tmp
cd /tmp
tar xf state.tgz
tar xf local.tgz


==============================

4、
vi etc/shadow
删除加密后的密文密码




==============================

5、
rm /tmp/state.tgz /tmp/local.tgz
tar czf /local.tgz etc/
tar czg state.tgz local.tgz


最后reboot重启

==============================
重启后就可以使用空密码登录



===================================================================

另外一种情况就是进入etc/shadow这个文件之后发现root用户后面没有密码加密后的密文,是空的,这个时候我们在"root:"后面随便写一些字符然后保存退出重启一遍,然后按照前面通过启动盘进入救援模式的步骤再来一遍 将之前随便写的一些字符删除,然后保存退出重启,这个时候步骤正确没问题的话,进入esxi主机后可以使用空密码登录然后重新设置新密码。