Cloud image镜像linux使用virt-customize工具修改密码 |
发表者:admin分类:云计算容器2021-04-27 17:32:05 阅读[1067] |
sudo yum install libguestfs-tools 或 sudo apt install libguestfs-tools 或 sudo dnf install libguestfs-tools
第二步,设定一个固定密码
sudo virt-customize -a CentOS-7-x86_64-GenericCloud-1703.qcow2 --root-password password:passw0rd
结束。
sudo virt-customize -a CentOS-7-x86_64-GenericCloud-1703.qcow2 --root-password random[ 0.0] Examining the guest ... [ 11.2] Setting a random seed [ 11.2] Setting passwords virt-customize: Setting random password of root to 132Tfe6cfCCr8Pv8 [ 12.2] Finishing off
这一步还可以是这样:安装或删除package,甚至同时设置自己的SSH key
sudo virt-customize -a CentOS-7-x86_64-GenericCloud-1703.qcow2 --install epel-release --ssh-inject centos:string:"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKCqX6EZIrGHoGaMII4QAqr0QC72t+Kg/c5ZIRNTMb6Q+BwzejQgjhBTXeyPnp0rfE9XI4pTxkZqAUOGSK9Bfqg= smiller@bruckner"
PermitRootLogin yesPasswordAuthentication yes
2. 重启sshd
转载请标明出处【Cloud image镜像linux使用virt-customize工具修改密码】。
《www.micoder.cc》
虚拟化云计算,系统运维,安全技术服务.
Tags: | [阅读全文...] |
最新评论