Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Clear The Credentials In AWS Configure?

I have deleted the AWS credentials in sudo nano ~/.aws/config. But, the credentials are still in aws configure. Is there a way to reset aws configure with clear state?

like image 562
ebertbm Avatar asked Sep 20 '17 10:09

ebertbm


People also ask

How do I clean up aws config?

Open the IAM console, and then in the navigation pane choose Users or Roles. Choose the user or role that you used to delete the AWS Config rule, expand Permissions boundary, and then choose JSON. In the JSON preview pane, confirm that the IAM policy allows permissions for the DeleteConfigRule API action.

Where does aws config store credentials?

The credentials file is located at ~/. aws/credentials on Linux or macOS, or at C:\Users\ USERNAME \. aws\credentials on Windows. This file can contain the credential details for the default profile and any named profiles.


2 Answers

just remove ~/.aws/credentials along with ~/.aws/config

EDIT: Note path references user home directory and specific to each user in system.

like image 54
pavan Avatar answered Sep 29 '22 12:09

pavan


Do not delete the files if you have multiple profiles created as all will be lost if you delete these files! unless thats what you want :)

Go to each of the file -

 - ~/.aws/credentials  - ~/.aws/config 

and remove just the part profiles you want to delete. Eg.

~/.aws/credentials

[default] aws_access_key_id=yourAccessKeyId aws_secret_access_key=yourSecretAccessKey  [user2] aws_access_key_id=yourAccessKeyId aws_secret_access_key=yourSecretAccessKey 

and

~/.aws/config

[default] region=us-west-2 output=json  [profile user2] region=us-east-1 output=text 

Just delete entries corresponding to user2 profile if thats what you want. And you should also give a profile name to profile you configure -

aws configure --profile user2 

Else it will just be [default]

More details - http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html

like image 24
Aniket Thakur Avatar answered Sep 29 '22 10:09

Aniket Thakur