A bash script or docker command for using AWS Multi Factor Authentication (MFA)
423
A bash script or docker command for using AWS Multi Factor Authentication (MFA).
aws-mfa can output credentials to file (.aws-session) or to the terminal (for use with eval).
--access-key-id # REQUIRED FOR authenticate command
--secret-access-key # REQUIRED FOR authenticate command
--mfa-device # REQUIRED FOR authenticate command
--mfa-token-code # REQUIRED FOR authenticate command
--region # OPTIONAL. Default: us-west-1
--output # OPTIONAL (file/terminal). Default: file
--debug # OPTIONAL (false/true). Default: false
Docker image kristofferahl/aws-mfa can be found on Docker Hub.
docker run --rm -it -v "${PWD}:/work" \
kristofferahl/aws-mfa:latest authenticate \
--access-key-id="" \
--secret-access-key="" \
--mfa-device="" \
--mfa-token-code=""
eval "$(docker run --rm \
kristofferahl/aws-mfa:latest authenticate \
--access-key-id='' \
--secret-access-key='' \
--mfa-device='' \
--mfa-token-code='' \
--output='terminal')"
curl https://raw.githubusercontent.com/kristofferahl/aws-mfa/master/aws-mfa.sh > ./aws-mfa.sh
source ./aws-mfa.sh
aws-mfa authenticate \
--access-key-id='' \
--secret-access-key='' \
--mfa-device='' \
--mfa-token-code=''
Content type
Image
Digest
Size
29.5 MB
Last updated
over 8 years ago
docker pull kristofferahl/aws-mfa:1.2.0