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 | |
# usage: . aws-cli-enable-mfa-token.sh ONE_TIME_PASS_CODE_FROM_YOUR_MFA_DEVICE | |
# IMPORTANT: there's a dot before the script name, to set the variables on the current shell. | |
ONE_TIME_PASS_CODE="$1" | |
MFA_DEVICE_SERIAL_CODE="" # use "aws iam list-mfa-devices --user-name YOUR_USERNAME" to find out what is your MFA device serial number. It's also on your security credentials user page on AWS console, IAM service. | |
AWS_JSON=$(aws sts get-session-token --serial-number "$MFA_DEVICE_SERIAL_CODE" --token-code "$ONE_TIME_PASS_CODE") | |
export AWS_ACCESS_KEY_ID=$(echo $AWS_JSON | jq -r .Credentials.AccessKeyId) |
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
user@debian:~$ \curl -L https://get.rvm.io | sudo bash -s head --add-to-rvm-group deploy | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 184 100 184 0 0 112 0 0:00:01 0:00:01 --:--:-- 157 | |
100 13171 100 13171 0 0 5326 0 0:00:02 0:00:02 --:--:-- 5326 | |
Downloading RVM from wayneeseguin branch master | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 124 100 124 0 0 126 0 --:--:-- --:--:-- --:--:-- 200 | |
100 3265k 100 3265k 0 0 307k 0 0:00:10 0:00:10 --:--:-- 571k |