Created
October 9, 2012 12:03
-
-
Save kiyoka/3858374 to your computer and use it in GitHub Desktop.
Decrypt password tool for windows EC2 instance
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 | |
# | |
# 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