【问题标题】:Passing a new keys into AWS CLI将新密钥传递到 AWS CLI
【发布时间】:2019-07-15 09:15:48
【问题描述】:

我安装了 aws cli 并提供了 aws 访问密钥 ID 和秘密访问密钥。一切都很完美!然后我删除了该用户,因为我不再需要它了。然后我创建了一个新用户(具有不同的访问密钥 ID 和秘密访问密钥)。 问题: 当我输入时

aws configure

我明白了:

AWS Access Key ID [****…]
AWS Secret Access Key [****...]

所以命令提示符使用的是以前的键。

如何在命令提示符中输入新密钥?

【问题讨论】:

    标签: amazon-web-services command-line-interface aws-cli


    【解决方案1】:

    忽略旧密钥并输入您的新密钥,它将被覆盖。

    【讨论】:

      【解决方案2】:

      只是想再添加一种方法。如果您不想覆盖当前用户而是添加另一个用户,这将特别有用。

      您可以使用配置文件选项添加更多凭据:
      aws configure --profile <my-new-profile-name> [1]

      如果您不使用配置文件选项,您将隐式配置 默认 的配置文件凭据。

      如果您想在之后使用配置文件,每个 aws cli 命令都提供配置文件选项,例如:aws s3 ls --profile <my-new-profile-name> [2]

      参考文献

      [1]https://docs.aws.amazon.com/cli/latest/reference/configure/
      [2]https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-07-12
        • 1970-01-01
        • 2020-01-03
        • 1970-01-01
        • 1970-01-01
        • 2013-02-05
        • 2015-03-29
        相关资源
        最近更新 更多