【发布时间】:2023-01-08 07:18:59
【问题描述】:
第一次提问所以请原谅我糟糕的问题格式。我正在运行最新(足够)的 Python、AWS CLI v2,与 MSI 一起安装,配置和凭证文件都有值,没有设置环境变量,Windows 10,使用命令提示符。
当我输入:
C:\Users\correctuser> aws --version
这是返回的内容:
aws-cli/2.5.2 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
当我输入:
C:\Users\correctuser> aws configure list
这就是我得到的:
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region us-west-2 config-file ~/.aws/config
//I have both regular and secret access keys set in the 'credentials' file in C:\users\correctuser.aws\credentials, and the region and format set in C:\users\correctuser.aws\config.
[default]
region = us-west-2
output = json
[default]
aws_access_key_id = thisisfakeaccesskeyID
aws_secret_access_key = thisisfakesecretaccesskeyID
然后当我输入:
C:\Users\GitUser>aws configure
AWS Access Key ID [None]: thisisfakeaccesskeyID
AWS Secret Access Key [None]: thisisfakesecretaccesskeyID
Default region name [us-west-2]:
Default output format [json]:
[Errno 13] Permission denied: 'c:\\users\\GitUser\\.aws'
我听说有时当您的文件名末尾没有反斜杠时会导致错误,但我不认为这是错误的。我还尝试以管理员身份运行命令提示符,但没有帮助。
你们怎么看?
【问题讨论】:
-
文件是否在某个应用程序中打开,该应用程序锁定了文件并且不允许您更新它?确保文件在所有地方都已关闭。
-
您在
C:\Users\GitUser中是否有名为.aws的文件(而不是目录)? -
文件在别处打不开,文件是文件不是目录。我发现了问题,但还没有解决。这是用户对文件没有的读/写权限。我试过通过管理员和我知道的每一种可用方式授予访问权限,但每次我点击应用然后确定,当我打开它备份时它取消了读/写选项
标签: python amazon-web-services command-prompt aws-cli credentials