如何在终端中编辑AWS凭证? [英] How to edit AWS Credentials in terminal?
问题描述
在终端的 aws configure
中编辑秘密密钥的命令是什么?
What is the command to edit secret key in aws configure
in terminal?
推荐答案
再次键入 aws configure
(或 aws configure --profile< profile_name>
来编辑具体配置文件).如果只是通过按Enter确认建议值,则该值将保持不变.
Just type aws configure
again (or aws configure --profile <profile_name>
to edit a specific profile). If you just confirm the suggested value by hitting enter, it will remain unchanged.
或
通过键入
$ aws configure set aws_secret_access_key< secret_key>
或
您可以通过编辑硬盘驱动器上的AWS凭证文件直接编辑AWS凭证.默认情况下, aws_access_key_id
和 aws_secret_access_key
存储在〜/.aws/credentials
文件中.您可以使用任何编辑器来编辑它们,例如vim,emacs或nano,例如
You can edit the AWS credentials directly by editing the AWS credentials file on your hard drive. The aws_access_key_id
and the aws_secret_access_key
are stored in the ~/.aws/credentials
file by default. You can use any editor to edit them, such as vim, emacs, or nano, e.g.
$ nano ~/.aws/credentials
此外,您可以使用配置文件在同一凭证文件中拥有许多不同的AWS账户的凭证.因此,如果您有一个 development
帐户和一个 production
帐户,则文件的内容可能看起来像
Additionally, you can have credentials for many different AWS accounts in the same credentials file by using profiles. As a result, if you have one development
account and one production
account, the content of the file may look like
[development]
aws_access_key_id = <key id of dev account>
aws_secret_access_key = <secret access key of dev account>
[production]
aws_access_key_id = <key id of prod account>
aws_secret_access_key = <secret access key of prod account>
(自然,您需要将<开发人员帐户的密钥ID>
,<开发人员帐户的秘密访问密钥>
替换为实际的IAM凭据,每个帐户)
(naturally, you need to replace <key id of dev account>
, <secret access key of dev account>
, etc with the actual IAM credentials for each account respectively)
参考: AWSCLI配置变量
这篇关于如何在终端中编辑AWS凭证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!