简体   繁体   English

尝试获取调用者身份时出现 InvalidClientTokenId 错误 aws

[英]InvalidClientTokenId error aws when trying to get caller identity

hi I am unable to run this command aws sts get-caller-identity .嗨,我无法运行此命令aws sts get-caller-identity

when I do sudo nano ~/.aws/credentials I can only locate this当我做sudo nano ~/.aws/credentials我只能找到这个

[default]
aws_access_key_id = my_id
aws_secret_access_key = my_secret_id

and after doing successful steps of command aws configure when I am doing aws sts get-caller-identity I am getting this error在我执行aws sts get-caller-identity时成功执行命令aws configure步骤后,我收到此错误

An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.调用GetCallerIdentity操作时出错(InvalidClientTokenId):请求中包含的安全令牌无效。

any reason which could cause this?任何可能导致这种情况的原因?

Sometimes this kind of issues are caused by another credential configuration.有时这类问题是由另一个凭据配置引起的。

Environment variables credential configuration takes prority over credentials config file.环境变量凭证配置优先于凭证配置文件。 So in case there are present the environment variables "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY" or "AWS_SESSION_TOKEN" these could generate issues if it were missconfigured or have been expired.因此,如果存在环境变量“AWS_ACCESS_KEY_ID”、“AWS_SECRET_ACCESS_KEY”或“AWS_SESSION_TOKEN”,如果配置错误或已过期,这些可能会产生问题。

Try checking the env vars associated to AWS Credentials and removing them using the 'unset' command in linux.尝试检查与 AWS 凭证关联的环境变量,并使用 linux 中的“取消设置”命令将其删除。

Additionally, to remove env vars permanently you need to remove the lines related on configuration files like:此外,要永久删除环境变量,您需要删除与配置文件相关的行,例如:

  • /etc/environment /etc/环境
  • /etc/profile /etc/profile
  • ~/.profile ~/.profile
  • ~/.bashrc ~/.bashrc

Reference:参考:

Configuration settings and precedence 配置设置和优先级

I had my default region disabled by default (eu-south-1), so I had to enable it via the Web console at first, then it worked.我默认禁用了我的默认区域(eu-south-1),所以我必须首先通过 Web 控制台启用它,然后它才起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 InvalidClientTokenId 在具有实例配置文件的 AWS EC2 实例上调用 get-caller-identity 时 - InvalidClientTokenId when calling get-caller-identity on an AWS EC2 instance with instance profile PHP,AWS API,使用角色,InvalidClientTokenId错误 - PHP, AWS API, using roles, InvalidClientTokenId error 初始化AWS Amplify时出现'InvalidClientTokenId'错误 - 'InvalidClientTokenId' error while initialising AWS Amplify 运行 Terraform 计划/应用时出现 InvalidClientTokenID 错误 - InvalidClientTokenID error when running Terraform Plan/Apply 如何解决“发生错误(InvalidClientTokenId)”AWS Chalice 部署错误 - how to solve “An error occurred (InvalidClientTokenId)” AWS Chalice deployment error 为什么 Aws-vault 身份验证失败? 使用凭据获取帐户 ID 时出错:调用 sts:GetCallerIdentity: InvalidClientTokenId 时出错 - Why did Aws-vault auth failed? error using credentials to get account ID: error calling sts:GetCallerIdentity: InvalidClientTokenId AWS::SES 响应错误:InvalidClientTokenId - 签名版本 3 请求已弃用 - AWS::SES Response Error: InvalidClientTokenId - Signature Version 3 requests are deprecated STS 获取来电者身份 C++ - STS Get Caller Identity C++ aws sts get-session-token ... --token-code ... 失败并显示 InvalidClientTokenId,但 MFA 控制台登录工作 - aws sts get-session-token … --token-code … fails with InvalidClientTokenId, but MFA console login working Aws-vault:无法获取凭据 - InvalidClientTokenId:请求中包含的安全令牌无效 - Aws-vault: Failed to get credentials - InvalidClientTokenId: The security token included in the request is invalid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM