Aws-cli: aws configure fails with [Errno 13] Permission denied

Created on 3 Apr 2018  路  3Comments  路  Source: aws/aws-cli

I am installing AWSCLI on Mac OS, but can't get past the configure-step because after entering the 4 settings (access key ID, secret access key, default region & default output format) I get the following error:

[Errno 13] Permission denied: '/Users//.aws/credentials'

I have also tried creating a file in the .aws folder, but it won't let me. I am not allowed to do anything in this folder. I have tried giving myself permission using the "sudo" command, but it does not work.

I noticed this issue was reported by someone on Windows as well, but that ticket has been closed since due to lack of response https://github.com/aws/aws-cli/issues/3032 . I am having this issue on Mac OS

guidance

Most helpful comment

Never mind. I figured it out. I had changed the permissions for the .aws folder using sudo chmod, but needed to do it for .aws/credentials and .aws/config as well. In the end I also made my user owner of both files (using sudo chown). After doing that I was able to succesfully configure AWS CLI and proceed.

All 3 comments

Never mind. I figured it out. I had changed the permissions for the .aws folder using sudo chmod, but needed to do it for .aws/credentials and .aws/config as well. In the end I also made my user owner of both files (using sudo chown). After doing that I was able to succesfully configure AWS CLI and proceed.

I was surprised to see this error myself. When I went to the file

$ ls -al
-r--------    1 nicholasbrady  staff   116 May 24 14:53 credentials

I saw that it was a read only file even for the owner of the file... so I updated it to be writable and sure enough it worked 馃帀馃槵

$ chmod +w credentials 
$ ls -al
-rw-------    1 nicholasbrady  staff   116 May 24 14:53 credentials

quick note and why I even made this comment - You don't need sudo since you already own the file. cheers 馃憤 hopefully it helps some of you :)

In my case it the same-rw------- and I still can't install.packages("aws.s3") or library(aws.s3).

This is full line:

-rw------- 1 root root 578 May 30 15:54 .aws/credentials

Was this page helpful?
0 / 5 - 0 ratings