Skip to content

Instantly share code, notes, and snippets.

@clavery
Created October 20, 2014 03:52
Show Gist options
  • Save clavery/ac5183b2da84618702d9 to your computer and use it in GitHub Desktop.
Save clavery/ac5183b2da84618702d9 to your computer and use it in GitHub Desktop.
Digital ocean droplet metadata to publish server key fingerprints to SNS topic
#!/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