可通过以下步骤实施:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "", "Resource": "", "Condition": { "Bool": { "aws:MultiFactorAuthPresent": false } } }, { "Effect": "Allow", "Action": "", "Resource": "" } ] }
aws iam enable-mfa-device --user-name
其中,“user-name”为用户名,“aws-account-id”为AWS账户ID,“code1”和“code2”是由MFA硬件生成的代码,用于验证身份。
注意:在实施这些步骤之前,请确保您已经创建了MFA设备。