echo "localhost" > /etc/hostname
Delete specific network manager settings.
nmcli connection delete <connection_name>
SSH server keys will be regenerated upon first boot.
rm -f /etc/ssh/ssh_host_*
find /var/log -type f -exec truncate -s 0 {} \;
For root and other users.
rm -f /root/.bash_history
rm -f /home/*/.bash_history
bash Copy code rm -rf /tmp/* rm -rf /var/tmp/*
Machine ID will regenerate on next boot.
echo "" > /etc/machine-id
dnf clean all
Ensure removal or reset of passwords for users if any custom ones were set.
Ensure any custom services or applications start in a default state suitable for new VMs.
Detach any temporary devices or external drives.
If installed, retain open-vm-tools for compatibility.
shutdown -h now