修改qcow2镜像密码
# Ubuntu
$ apt install -y qemu-kvm libvirt-bin bridge-utils virt-manager
# CentOS
$ yum install -y qemu-kvm libvirt virt-install bridge-utils
systemctl start libvirtd
[root@192 home]# openssl passwd -1 123456
$1$Nnv2QHyN$qu2bZyh7ef7xQJZnRtDSJ
[root@192 system]# guestfish --rw -a CentOS-7-x86_64-GenericCloud-1805.qcow2
Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.
Type: ‘help’ for help on commands
‘man’ to read the manual
‘quit’ to quit the shell
><fs>
><fs> run
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
><fs> list-filesystems
/dev/sda1: xfs
><fs> mount /dev/sda1 /
><fs> vi /etc/shadow #替代root的秘密,利用前面openssl生成的密码
><fs> quit
-
« 上一篇:
83.inotifywait基本使用
-
85.开机报Entering emergenc mode
:下一篇 »