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 Antworten
0

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

EC2
beantwortet vor einem Jahr
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
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen