我在我的cygwin上安装了aws cli,创建了一个IAM用户,下载了其访问密钥信息。
~/.aws/credentials
包含中的
[default]
aws_access_key_id = xxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
和~/.aws/config
包含
[default]
region = us-east-1
output = text
但我收到身份验证错误:
$ aws ec2 describe-regions
A client error (AuthFailure) occurred when calling the DescribeRegions operation: AWS was not able to validate the provided access credentials
知道我哪里错了吗?
答案 0 :(得分:0)
查看How to get AWS command line interface to work in cygwin - 它声称它在AWS_CONFIG_FILE环境变量中查找凭据,而不是〜/ .aws /
,还有CLI的PowerShell版本答案 1 :(得分:0)
我会检查$ PATH是否在〜/ .bashrc中正确导出,如果没有添加下面的行,如果还没有那么。
export PATH="$PATH:$HOME/.aws"
要在用户登录时进行检查,请尝试
#echo $aws_access_key_id
#echo $aws_secret_access_key
在shell上确认他们正在显示凭据。 如果您仍然无法继续尝试使用命令
再次添加凭据#aws configure
祝你好运,希望有所帮助。