Chris Chevalier
Chris Chevalier

Reputation: 196

AWS CLI has my credentials but I don't have a credential file

I can run the AWS CLI aws configure command and it lists my credentials. I even have a named profile I use.

However, my system does not have Users\{profile}\.aws\credentials file. Where could my credentials be stored?

The following command returns this but ~/.aws/config is empty for all the accounts I have on this machine. I have hidden files shown.

$aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************BBBB             shared-credentials-file
secret_key     ****************BBBB             shared-credentials-file
    region                us-east-1      config-file    ~/.aws/config

Upvotes: 2

Views: 16447

Answers (3)

Gozar-Manu Ariana
Gozar-Manu Ariana

Reputation: 59

I run into a similar issue and the problem was the company's Comodo Antivirus that redirected my aws-mfa process to some kind of quarantine folder.

  1. in C:\ show Hidden items and check if you have VTRoot folder
  2. If yes, you might have the same issue: search inside the HarddiskVolume folders the credentials file. My path was C:\VTRoot\HarddiskVolume3\Users\[my-user-name]\.aws\credentials
  3. An exception for the aws-mfa.exe should be added in Comodo (The sys. admin fixed it in my case)

Upvotes: 0

I have solved this creating a profile:

  1. aws configure --profile {profile-name}
  2. set any values
  3. The /.aws/ folder have been created and now you can edit their files.

Upvotes: 2

As others pointed out the location of your AWS credentials should be in %USERPROFILE%\.aws

Follow these steps and let's see what you get

  1. Open terminal
  2. Run: cd %UserProfile%\.aws
  3. Run: type credentials

Another option is that you have added AWS_SHARED_CREDENTIALS_FILE environment variable. This changes the default location of the shared credentials file (https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#the-shared-credentials-file). Try these steps:

  1. Open terminal
  2. Run: echo %AWS_SHARED_CREDENTIALS_FILE%
  3. Run: type %AWS_SHARED_CREDENTIALS_FILE%

Upvotes: 0

Related Questions