首页 > 解决方案 > AWS MFA 问题 请验证您的 MFA 序列号是否有效并与该用户关联

问题描述

一直在使用https://github.com/broamski/aws-mfa为 AWS 处理 MFA 并取得了很大的成功。我有三个用户在尝试使用它时遇到以下错误:

An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed, unable to validate MFA code. Please verify your MFA serial number is valid and associated with this user.

关于如何排除故障的任何想法?我有 20 多个用户都很好;对于这三个用户的不同之处,我已经走到尽头了。我已经验证他们没有在他们的凭证文件中复制粘贴错误。

标签: amazon-web-servicesmulti-factor-authentication

解决方案


如果您没有指定配置文件(内联或作为环境变量),您会得到这个。您不需要删除默认配置文件,如果未在上下文中指定命名配置文件,则它使用默认配置文件。

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

$ export AWS_PROFILE=user1

推荐阅读