EC2授权访问S3的role后,EC2上执行aws s3 ls报没有aws configure

0

EC2上授权了访问s3的role,但是在服务器内还是报没有配置AK

root~]# aws s3 ls

Unable to locate credentials. You can configure credentials by running "aws configure".

2개 답변
0

aws configure region 部分给一个区域再试试,或者把之前生成的.aws文件都删掉

EC2
답변함 일 년 전
0

您好,

如遇到找不到凭证的问题,可先检查您是否成功设定您的凭证,检查方式请执行命令

aws configure list

此时会出现目前实例优先读取的凭证,范例输出如下(注:Type项目中也可能显示env、iam-role取决于您凭证的设定方式与读取凭证的优先顺序[1])

    Name                    Value             Type    Location
    ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************ABCD shared-credentials-file    
secret_key     ****************EFIJ shared-credentials-file    
    region                <not set>             None    None

如果实例并未成功读取凭证或是未设定凭证时,则会出现以下输出

Name                    Value             Type                Location
----                    -----             ----                --------
profile                <not set>          None                None
access_key             <not set>          None                None
secret_key             <not set>          None                None
region                 <not set>          None                None

此时,请重新使用指令进行设定

aws configure

也可以参考其他设定的方式,相关的文档请参考附件[1]。设定完成后可以使用上面的检查指令检查现在实例的凭证是否成功并正确的设定。
更新完成后,即可尝试执行

aws s3 ls

[1] https://docs.aws.amazon.com/zh_cn/cli/latest/userguide/cli-chap-configure.html#cli-configure-quickstart-config
[知识中心相关文章] https://repost.aws/zh-Hans/knowledge-center/s3-locate-credentials-error

AWS
Ling_L
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠