虚拟机的模板机制作
清除网卡的配置信息
[root@template ~]# cd /etc/sysconfig/network-scripts/
[root@template network-scripts]# ls
ifcfg-ens160
[root@template network-scripts]# vi ifcfg-ens160
[root@template network-scripts]# cat ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=ens160
DEVICE=ens160
ONBOOT=yes
清除密钥信息
[root@template ~]# cd /etc/ssh/
[root@template ssh]# pwd
/etc/ssh
[root@template ssh]# ls
moduli ssh_config.d ssh_host_ecdsa_key ssh_host_ed25519_key ssh_host_rsa_key
ssh_config sshd_config ssh_host_ecdsa_key.pub ssh_host_ed25519_key.pub ssh_host_rsa_key.pub
[root@template ssh]# rm -rf ssh_host_*
[root@template ssh]# ls
moduli ssh_config ssh_config.d sshd_config
清除machine id
[root@template ~]# cat /etc/machine-id
e0f4566fd77c499b92ac611992cfea35
[root@template ~]# cat /dev/null > /etc/machine-id
[root@template ~]# cat /etc/machine-id
[root@template ~]#
关闭虚拟机
克隆
![img]()