Created
November 12, 2013 17:53
-
-
Save blakeblackshear/7435473 to your computer and use it in GitHub Desktop.
Create a script to create a script that loads your aws credentials. Encrypts your secret key.
This file contains hidden or 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/sh | |
echo "Enter your AWS Access Key: " | |
read access_key | |
echo "Enter your AWS Secret Key: " | |
read secret_key | |
encrypted=$(echo $secret_key | openssl aes-256-cbc -a -salt) | |
cat >~/bin/loadawscred <<- _EOF_ | |
#!/bin/sh | |
export AWS_ACCESS_KEY_ID=$access_key | |
export AWS_SECRET_ACCESS_KEY=\$(echo "$encrypted" | openssl aes-256-cbc -d -a) | |
_EOF_ | |
chmod 700 ~/bin/loadawscred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment