Centos8 template cleanup suggestions please
Background : I haven't really used any Redhat distro regularly since 2006 .
At this point, I am a sort of a noob to all the changes in centos land (learning a ton over the weekend.)
At least systemd is the same everywhere.
So, I decided to make a centos8 KVM base template for my proxmox nodes after realizing that apnscp is CENTOS-only. (I usually just use hetzner cloud for Centos)
Here is a gist I found online (minus some vmware guest agent) Credit : https://gist.github.com/efeldhusen/4bea2031525203b1658b444f4709c12c
Any Edits or other suggestions members have for Centos8 compatibiliy?
It mostly looks good to me.
#!/bin/bash #Paths are for Centos 7.x # Install optional packages /usr/bin/yum install -y epel-release /usr/bin/yum install -y bash-completion htop yum-utils dkms #stop logging services /sbin/service rsyslog stop /sbin/service auditd stop #remove old kernels /usr/bin/package-cleanup --oldkernels --count=1 #clean yum cache /usr/bin/yum clean all #force logrotate to shrink logspace and remove old logs as well as truncate logs /usr/sbin/logrotate -f /etc/logrotate.conf /bin/rm -f /var/log/*-???????? /var/log/*.gz /bin/rm -f /var/log/dmesg.old /bin/rm -rf /var/log/anaconda /bin/cat /dev/null > /var/log/audit/audit.log /bin/cat /dev/null > /var/log/wtmp /bin/cat /dev/null > /var/log/lastlog /bin/cat /dev/null > /var/log/grubby #remove udev hardware rules /bin/rm -f /etc/udev/rules.d/70* #remove uuid from ifcfg scripts /bin/sed -i '/^(HWADDR|UUID)=/d' /etc/sysconfig/network-scripts/ifcfg-myENSinterface_code #remove SSH host keys /bin/rm -f /etc/ssh/*key* #remove root users shell history /bin/rm -f ~root/.bash_history unset HISTFILE #remove root users SSH history /bin/rm -rf ~root/.ssh/ poweroff