Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
quick and dirty linux "sysprep"
# remove IP / set IP to one that won't be used for other systems
# clear ssh host key
rm -rf /etc/ssh/ssh_host_*
# remove /etc/hosts entries as applicable
# remove utmp data - wtmp and btmp and lastlog
rm /var/log/{w,b}tmp /var/log/lastlog ;
touch /var/log/{w,b}tmp /var/log/lastlog ;
chown root.utmp /var/log/{w,b}tmp /var/log/lastlog ;
chmod 660 /var/log/btmp ;
chmod 664 /var/log/wtmp /var/log/lastlog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment