当前位置:网站首页>KVM虚拟机救援模式修改root密码 —— 筑梦之路
KVM虚拟机救援模式修改root密码 —— 筑梦之路
2022-06-21 20:40:00 【筑梦之路】
KVM 虚拟机挂载iso镜像进入救援模式
操作步骤如下:
关闭虚拟机
虚拟机xml 添加cdrom配置
修改虚拟机xml boot启动项
虚拟机加载光盘镜像进入救援模式
修改系统密码文件,关机
修改xm文件boot启动项,开机
关闭虚拟机
virsh destroy guest-rhel7
编辑虚拟机文件
virsh edit guest-rhel7
添加cdrom镜像
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/kvm/iso/CentOS-7-x86_64-DVD-2009.iso'/>
<target dev='hda' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
修改虚拟机xml文件,将boot 改为光盘启动
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
<boot dev='cdrom'/>
<bootmenu enable='yes'/>
</os>
开启虚拟机
virsh start guest-rhel7
查看vnc端口
virsh vncdisplay guest-rhel7
:0
虚拟机开机加载ISO光盘镜像




修改Root密码
编辑 /etc/shadow文件,删除第一个:和第二个:之间的整个字符串

编辑完成后,按以下顺序按以下键保存文件Esc -> : -> wq!

退出 chroot 控制台 ,systemctl poweroff 关闭计算机

修改虚拟机xml 文件中boot 启动项,修改为硬盘启动

虚拟机启动后,使用root账户登录系统,此时root密码为空,并通过执行 passwd 命令为 root 用户设置新密码。
边栏推荐
- 流式细胞分析Flowjo 10介绍以及超详细图文安装激活教程
- gdb调试技巧(0)gdb入门
- Qt滚动区域QScrollArea
- 力扣刷題集結4(mysql版本)
- 分别利用for、while、do while,循环求1-100的和
- About Eureka starting successfully but accessing 404
- Paml| Shengxin software for calculating dn/ds value
- Jeu de boutons de force 4 (version MySQL)
- University of Virginia: ingy Elsayed aly | logic based reward formation in Multi-Agent Reinforcement Learning
- Use for, while and do while to find the sum of 1-100 circularly
猜你喜欢

【深入理解TcaplusDB技术】TcaplusDB业务数据备份

Apache ShardingSphere 5.1.2 发布|全新驱动 API + 云原生部署,打造高性能数据网关

五分钟带你了解云原生

弗吉尼亚大学:Ingy ElSayed-Aly | 多智能体强化学习中的基于逻辑的奖励形成

Beijing accelerates ecological construction, Medtronic Internet and Moore thread complete product compatibility and mutual certification

Jeu de boutons de force 4 (version MySQL)

力扣刷题集结4(mysql版本)

力扣刷題集結4(mysql版本)
![[deeply understand tcapulusdb technology] tcapulusdb import data](/img/a8/04c4c6703a6137d17666f211d7988d.png)
[deeply understand tcapulusdb technology] tcapulusdb import data

Learn vector -- how to use common interfaces
随机推荐
Pi4j GPIO pin pull-up resistance, pull-down resistance concept
Zhengweimin, academician of the Chinese Academy of Engineering: I am optimistic that China will have a place in the next it Era
Dotter| dot method sequence pairwise comparison software
Notes on topic brushing (16) -- binary tree: modification and construction
Summary of Li Kou brush questions 4 (MySQL version)
关于lg(n!)的渐进紧确界
刷题笔记(十七)--二叉搜索树:关于属性问题
企业微信内置应用h5开发记录-1
Anaconda add channels
Iqtree| software for constructing evolutionary tree
Use the while loop to calculate the odd and even sums in 1-100 [method 1]
High level project - project initiation management
About Eureka starting successfully but accessing 404
小程序与工业互联网能够相辅相成的原因
MitoZ|Multi-Kmer mode
Technology sharing | mysql:caching_ sha2_ Password quick Q & A
【深入理解TcaplusDB技术】单据受理之表管理
UEFI 双系统+双硬盘安装
PAML|计算dN/dS值的生信软件
分别利用for、while、do while,循环求1-100的和