6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-05 04:48:00 +00:00
tutor/cloud/clean.sh
Régis Behmo dabf22282c Pull vendor images as part of aws deployment
Also, don't run clean script as sudo.
2019-03-13 18:28:13 +01:00

10 lines
473 B
Bash
Executable File

#! /bin/bash
# Clean an AWS instance so that it becomes ready for creating an AMI
# See https://aws.amazon.com/articles/how-to-share-and-use-public-amis-in-a-secure-manner/
# Run with: curl -sSL https://raw.githubusercontent.com/regisb/tutor/master/cloud/clean.sh | bash -e
echo "=============== Clean authorized keys"
sudo find / -name "authorized_keys" -exec rm -f {} \;
echo "=============== Clean history"
sudo find /root/.*history /home/*/.*history -exec rm -f {} \;