Skip to content

Instantly share code, notes, and snippets.

@verdimrc
Created March 4, 2024 12:38
Show Gist options
  • Save verdimrc/7d99a6d4966cf4ef5eae4b11e6fedd68 to your computer and use it in GitHub Desktop.
Save verdimrc/7d99a6d4966cf4ef5eae4b11e6fedd68 to your computer and use it in GitHub Desktop.
aws-cli-mfa-osx.md
# Install awsume https://awsu.me/
$ brew install awsume

# Edit ~/.aws/config, and create a profile:
$ vi ~/.aws/config
[hyperpod]
output = json
region = us-west-2
mfa_serial = arn:aws:iam::<ACC_ID>:mfa/<MFA_NAME>

# Make sure to have the corresponding credentials in ~/.aws/credentials
$ vi ~/.aws/credentials
[hyperpod]
aws_access_key_id = ...
aws_secret_access_key = ...

# Then, from command line, authenticate with MFA to get a temporary credential
$ . awsume hyperpod -o hyperpod-session
MFA: <ENTER MFA>

# Use the temporary credential
$ . awsume hyperpod-session
$ ssh ml-cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment