安装libguestfs-tools
yum -y install libguestfs-tools.noarch
设置固定密码
virt-customize -a CentOS-7-x86_64-GenericCloud-1907.qcow2 --root-password password:password
设置随机密码
virt-customize -a CentOS-7-x86_64-GenericCloud-1907.qcow2 --root-password random
设置root-ssh登录
vim /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
systemctl restart sshd