How to Clear your AWS CLI Credentials
Clear your AWS CLI Credentials
In order to clear your AWS CLI Credentials you have to:
Locate the
credentials
andconfig
files. The path depends on your operating system:
shell
Open the files in a text editor and remove the unnecessary profiles. A profile's configuration is split between the
credentials
andconfig
files in the following way:
credentials
config
Once the unnecessary profiles are deleted from your
credentials
andconfig
files, save the changes and the profile is removed from your machine
If your credentials
and config
files contain a single profile, you can just delete the files to clear your AWS CLI credentials. The next time you run the aws configure
command, the AWS CLI will automatically re-create them for you.
Be sure to delete any configuration referencing a profile from both files - credentials
and config
.
The next time you need to add your AWS CLI credentials, you can run the aws configure
command to either add a profile to the list or re-create the config
and credentials
files on your machine:
shell
The access and secret access keys will be stored in the credentials
file, whereas the region and output format will be in the config
file.
参考资料
最后更新于