Last active
September 23, 2021 18:21
-
-
Save aabenitez/45148bc92bb582c5fce0c16ffc2c9e56 to your computer and use it in GitHub Desktop.
Seal for clean a VM (machine-id and users log data) for Proxmox - Ubuntu 18.04+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /usr/local/sbin/vm-seal.sh | |
unset HISTFILE | |
apt-get update -y | |
apt-get upgrade -y | |
> /etc/machine-id | |
hostnamectl set-hostname localhost.localdomain | |
rm -f /etc/ssh/ssh_host_* | |
rm -rf /root/.ssh/ | |
rm -f /root/.bash_history | |
rm -f /var/log/boot.log | |
rm -f /var/log/cron | |
rm -f /var/log/dmesg | |
rm -f /var/log/grubby | |
rm -f /var/log/lastlog | |
rm -f /var/log/maillog | |
rm -f /var/log/messages | |
rm -f /var/log/secure | |
rm -f /var/log/spooler | |
rm -f /var/log/tallylog | |
rm -f /var/log/wpa_supplicant.log | |
rm -f /var/log/wtmp | |
rm -f /var/log/apt/term.log | |
rm -f /var/log/audit/audit.log | |
rm -f /var/log/tuned/tuned.log | |
sys-unconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment