Skip to content

Commit

Permalink
regenerating root key and removing public key before creating the AMI
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny Gryp committed Sep 8, 2015
1 parent c8c2d59 commit 8fefaf1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions centos-i386.json
Expand Up @@ -89,6 +89,12 @@
"type": "shell",
"only": ["virtualbox-iso", "vmware-iso"]
},
{
"script": "provisioners/amazon-ebs-32bit.sh",
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"only": ["amazon-ebs"]
},
{
"script": "provisioners/cloud.sh",
"type": "shell",
Expand Down
11 changes: 11 additions & 0 deletions provisioners/amazon-ebs-32bit.sh
@@ -0,0 +1,11 @@
#!/bin/sh

#----------------------------------------------
# amazon AMI instance is built from
# http://www.nixknight.com/2014/04/build-ebs-backed-centos-ec2-ami-from-scratch/
#
# we want rc.local to reexecute everything
echo "Cleanup -- making sure password gets regenerated"
touch /root/firstrun
echo "Cleanup -- removing authorized_keys for root"
rm -rf /root/.ssh/authorized_keys

0 comments on commit 8fefaf1

Please sign in to comment.