Skip to content

Instantly share code, notes, and snippets.

@JimOfLeisure
Last active January 7, 2022 18:09
Show Gist options
  • Save JimOfLeisure/0e779c8610889e3b823ccf63ce087552 to your computer and use it in GitHub Desktop.
Save JimOfLeisure/0e779c8610889e3b823ccf63ce087552 to your computer and use it in GitHub Desktop.
A copy & paste thing to enter AWS keys without having them show up in command history or on-screen
echo "Paste in AWS_ACCESS_KEY_ID" && \
read -s AWS_ACCESS_KEY_ID && \
echo "Paste in AWS_SECRET_ACCESS_KEY" && \
read -s AWS_SECRET_ACCESS_KEY && \
export AWS_ACCESS_KEY_ID && \
export AWS_SECRET_ACCESS_KEY && \
echo "aws key ready for use"
@JimOfLeisure
Copy link
Author

JimOfLeisure commented Jan 7, 2022

On machines where I don't have a secure way to store AWS credentials I've been using read -s to enter them so the key and secret don't appear in command history or on-screen. I just whipped this up as a one-shot copy/paste so I can paste it in the shell then copy/paste the key and secret from my password safe app.

Note that the key and secret are still available to anything in that context that bothers to look at the environment, so only use this in shells with things you want to grant access to aws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment