Skip to content

Instantly share code, notes, and snippets.

@heath
Forked from blakeblackshear/createawscred.sh
Created November 12, 2013 17:53
Show Gist options
  • Select an option

  • Save heath/7435487 to your computer and use it in GitHub Desktop.

Select an option

Save heath/7435487 to your computer and use it in GitHub Desktop.
#!/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