AWS CLI Command to remove configured aws credentials (access_key and secret_access_key)

0

I configured the aws credentials in the codebase using command aws config however now I want to remove those credentials and the update the new one but I am unable to remove using the below commands: aws configure unset aws_access_key_id aws configure unset aws_secret_access_key aws configure unset region

Please help me how to achieve this

1 Answer
1
Accepted Answer

Hello.

If you run "aws configure" again and enter a new access key etc., it should be overwritten.

aws configure

AWS Access Key ID [*****Z2UD]: *****
AWS Secret Access Key [*****NBuv]: *****
Default region name [ap-northeast-1]: ap-northeast-1
Default output format [json]: json

Alternatively, I think it can be resolved by deleting or rewriting the contents of "~/.aws/credentials" and "~/.aws/config" as described in the StackOverFlow below.
https://stackoverflow.com/questions/46319880/how-do-i-clear-the-credentials-in-aws-configure

profile picture
EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions