aws配置删除访问密钥配置文件

jeb*_*jeb 3 amazon-web-services aws-cli

我似乎在删除为测试用户创建的访问密钥配置文件时遇到了困难

aws configure --profile testuser
Run Code Online (Sandbox Code Playgroud)

我已经尝试删除我的~/.aws目录中的条目但是当我运行时aws configure,我收到以下错误.

botocore.exceptions.ProfileNotFound: The config profile (testuser) could not be found

解决方法是添加[profile testuser]我的~/.aws/config文件,但我不想这样做.我想从我的机器中删除此testuser配置文件的所有痕迹.

Joh*_*ein 5

" 配置AWS命令行界面"文档页面列出了存储配置文件的各个位置,例如:

  • Linux的: ~/.aws/credentials
  • 视窗: C:\Users\USERNAME \.aws\credentials

还有一个默认配置文件,听起来像是可能导致您的情况:

  • Linux的: export AWS_DEFAULT_PROFILE=user2
  • 视窗: set AWS_DEFAULT_PROFILE=user2

我建议检查是否已设置该环境变量.