wiki:aws_cli_2fa
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:aws_cli_2fa [2024/10/24 08:59] – [AWS CLI with 2FA] antisa | wiki:aws_cli_2fa [2024/12/29 14:05] (current) – [AWS CLI with 2FA] add aws-vault tool link antisa | ||
|---|---|---|---|
| Line 53: | Line 53: | ||
| Here's a bash script that adds the creds each time to the file. Just pass it token-code and add your serial number. Remember to source it e.g. | Here's a bash script that adds the creds each time to the file. Just pass it token-code and add your serial number. Remember to source it e.g. | ||
| . ~/ | . ~/ | ||
| + | |||
| + | Or just use [[https:// | ||
| <file bash aws_get_session.sh> | <file bash aws_get_session.sh> | ||
| Line 60: | Line 62: | ||
| # . ~/ | # . ~/ | ||
| - | #set -x | + | # debug |
| + | # set -x | ||
| + | |||
| + | if [ " | ||
| + | then | ||
| + | echo "Hey, you should source this script, not execute it!" | ||
| + | echo "e.g. '. aws_get_session.sh 1234'" | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | if [ -z $1 ];then | ||
| + | echo "You must provide 2FA token!" | ||
| + | return 1 | ||
| + | fi | ||
| # colors | # colors | ||
| On_Yellow=' | On_Yellow=' | ||
| Line 89: | Line 105: | ||
| ====== See also ====== | ====== See also ====== | ||
| + | * [[wiki: | ||
| ====== References ====== | ====== References ====== | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
wiki/aws_cli_2fa.1729760354.txt.gz · Last modified: by antisa
