In sudo nano /.aws/config, I erased the AWS credentials. The credentials, however, remain in aws configure. Is there a way to reset aws configure with clear state?
Asked by ebertbm
Simply delete /.aws/credentials and /.aws/config.
EDIT: Please note that the path refers to the user’s home directory and is unique to each user in the system.
Answered by pavan
If you’ve made numerous profiles, don’t remove the files since you’ll lose them all if you do! Unless that’s what you’re looking for:)
Go to each of the files one by one –
- ~/.aws/credentials - ~/.aws/config
Remove only the section profiles you wish to get rid of. Eg.
[default] aws_access_key_id=yourAccessKeyId aws_secret_access_key=yourSecretAccessKey
[default] region=us-west-2 output=json
If that’s what you want, simply delete the entries corresponding to the user2 profile. You should also give the profile you’re configuring a name –
aws configure --profile user2
Otherwise, [default] will be used.
http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html for more information.
Answered by Aniket Thakur
For Mac users, here is a graphical presentation.
Answered by Kirtikumar A.
I’m not sure if this clears the credentials, but I was able to replace them by rerunning aws configure and providing new credentials. By typing aws configure —newusername, I was also able to create several profiles and run a future command with that user by appending —profile newusername. This is a good tutorial: https://www.crybit.com/configure-iam-user-on-your-linux-machine/
Answered by Jeffrey Kozik
Post is based on https://stackoverflow.com/questions/46319880/how-do-i-clear-the-credentials-in-aws-configure