Sysprep | Linux

preserve_hostname: false manage_etc_hosts: true ssh_pwauth: false disable_root: false Here is the battle-tested, distro-agnostic flow for Linux sysprep: Step 1: Provision a "clean" VM (not container) Build a VM exactly how you want your golden image: packages, configs, users, hardening. Step 2: Run the Generalization Script Save this as /usr/local/sbin/sysprep-linux.sh :

Run it as root, then capture the image from the powered-off VM. When you deploy from this image, pass cloud-init user-data: linux sysprep

If you’re coming from the Windows world, you know the drill: run sysprep /generalize , shut down, capture the image. It strips away unique identifiers: the SID, computer name, driver caches, and logs. It prepares the OS to be born again on new hardware. It strips away unique identifiers: the SID, computer

Next time you're about to clone a Linux VM, stop. Run the script. Let the machine die a little. Then, when it boots for the first time, it will live properly—unique, secure, and ready. Run the script

echo "=== Sysprep complete. Shutting down for imaging. ===" shutdown -h now