Skip to content

Instantly share code, notes, and snippets.

@blakeblackshear
Created November 12, 2013 17:53
Show Gist options
  • Save blakeblackshear/7435473 to your computer and use it in GitHub Desktop.
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.
#!/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