Created
October 20, 2014 03:52
-
-
Save clavery/ac5183b2da84618702d9 to your computer and use it in GitHub Desktop.
Digital ocean droplet metadata to publish server key fingerprints to SNS topic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get -y update | |
apt-get install -y awscli | |
RSA_FINGERPRINT=$(ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub) | |
ECDSA_FINGERPRINT=$(ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub) | |
export AWS_DEFAULT_REGION=us-east-1 | |
export AWS_ACCESS_KEY_ID=Fillthisin | |
export AWS_SECRET_ACCESS_KEY='Fillthisin' | |
aws sns publish --topic-arn arn:aws:sns:us-east-1:fill:thisin --message "${RSA_FINGERPRINT} --- ${ECDSA_FINGERPRINT}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment