Skip to content

Instantly share code, notes, and snippets.

@eqhmcow
Created August 19, 2016 14:10
Show Gist options
  • Save eqhmcow/886717fc3b584118c954e9be5544dc28 to your computer and use it in GitHub Desktop.
Save eqhmcow/886717fc3b584118c954e9be5544dc28 to your computer and use it in GitHub Desktop.
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