Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Common cleanup script (one-sysprep) #127

@kvaps

Description

@kvaps

I think it would be nice to provide single cleanup script, for remove all sensitive information from the images after preparation.

I leave there a few examples that can go in there.

Linux

Clean package cache:

# Ubuntu / Debian
apt-get clean all

# Centos
yum clean all

# Alpine
rm -rf /var/cache/apk/*

# openSUSE
zypper clean --all

Remove root password

passwd -d root

Remove network configuration

# Ubuntu / Debian
# TODO

# Centos
# TODO

# Alpine
# TODO

# openSUSE
rm -f /etc/sysconfig/network/ifcfg-eth*
rm -f /etc/sysconfig/network/routes
sed -i '/^NETCONFIG_DNS_STATIC_SERVERS=/ s/=.*$/=""/' /etc/sysconfig/network/config
sed -i '/^NETCONFIG_DNS_STATIC_SEARCHLIST=/ s/=.*$/=""/' /etc/sysconfig/network/config
sed -i '/^ *[^#]/d' /etc/resolv.conf

Remove DNS configuration

sed -i '/^ *[^#]/d' /etc/resolv.conf

Clear bash/ash history:

rm -f ~/.*_history

Remove host ssh keys:

rm -f /mnt/etc/ssh/ssh_host_* 

Something else?

Windows

Clean opennebula-contextulization logs:

rm -force C:\.opennebula-context.out
  • Run sysprep - it's already cleaning everything well

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions