- Identifies "reconfigure"
touch /.unconfigured
- delete ssh host key
rm -rf /etc/ssh/ssh_host_*
- Restore the original hostname "localhost"
# CentOS6
sed -i '/^HOSTNAME/cHOSTNAME=localhost.localdomain' /etc/sysconfig/network
# CentOS7
sed -i '/^HOSTNAME/cHOSTNAME=localhost.localdomain' /etc/hostname
- clean up udev
rm -rf /etc/udev/rules.d/70-*
- Delete NIC hardware identification
sed -i -e '/HWADDR/d' -e '/UUID/d' /etc/sysconfig/network-scripts/ifcfg-{eth,enp}*
- clear log
rm -rf /var/log/*
- Shut down the virtual machine
poweroff