0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS CLIでのMFA認証手順(個人メモ)

0
Posted at

AWS CLIでのMFA認証コマンドまとめ

1. get-session-token を使ってMFAセッションを取得

aws sts get-session-token --serial-number arn:aws:iam:<AWSアカウントID>:mfa/<MFA認証デバイス名> --token-code <MFA認証コード>

2.取得した一時クレデンシャルを環境変数に設定

コマンドを叩くと、以下のクレデンシャル情報が出てくるので、環境変数に設定

{
    "Credentials": {
        "AccessKeyId": "××××××××××××",
        "SecretAccessKey": "××××××××××××",
        "SessionToken": "××××××××××××",
        "Expiration": "2026-05-28T22:22:20+00:00"
    }
}
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_SESSION_TOKEN=

3. 確認

kubectl get nodes

入れてたら、認証が必要なコマンドも実行できるようになる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?