Skip to content

Instantly share code, notes, and snippets.

@kiyoka
Created October 9, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiyoka/3858374 to your computer and use it in GitHub Desktop.
Save kiyoka/3858374 to your computer and use it in GitHub Desktop.
Decrypt password tool for windows EC2 instance
#!/bin/bash
#
# Decrypt password tool for windows EC2 instance
#
# 1. Launch windows instance
# 2. Select [Get System Log] item from [Instance Actions] pull down menu.
# 3. Copy the text between the <password> and </password> tags into a temp file.
# 4. Decrypt the file
# decrypt_aws_password.sh tempfile.txt
#
PKEY=~/.ssh/id_rsa
if [ "$1" = "" ] ; then
echo "usage: "
echo " decrypt_aws_password.sh tempfile.txt"
exit 1
fi
base64 -d -i $1 | openssl rsautl -decrypt -inkey ${PKEY}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment