2020-02-06 17:20:16 +01:00
|
|
|
---
|
2021-11-23 00:57:25 +01:00
|
|
|
layout: "docs"
|
|
|
|
page_title: "Command: logout"
|
|
|
|
sidebar_current: "docs-commands-logout"
|
|
|
|
description: |-
|
|
|
|
The terraform logout command is used to remove credentials stored by terraform login.
|
2020-02-06 17:20:16 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# Command: logout
|
|
|
|
|
|
|
|
The `terraform logout` command is used to remove credentials stored by
|
|
|
|
`terraform login`. These credentials are API tokens for Terraform Cloud,
|
|
|
|
Terraform Enterprise, or any other host that offers Terraform services.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `terraform logout [hostname]`
|
|
|
|
|
|
|
|
If you don't provide an explicit hostname, Terraform will assume you want to
|
|
|
|
log out of Terraform Cloud at `app.terraform.io`.
|
|
|
|
|
|
|
|
-> **Note:** the API token is only removed from local storage, not destroyed on
|
|
|
|
the remote server, so it will remain valid until manually revoked.
|
|
|
|
|
|
|
|
## Credentials Storage
|
|
|
|
|
|
|
|
By default, Terraform will remove the token stored in plain text in a local CLI
|
|
|
|
configuration file called `credentials.tfrc.json`. If you have configured a
|
2021-11-23 00:57:25 +01:00
|
|
|
[credentials helper program](/docs/cli/config/config-file.html#credentials-helpers), Terraform
|
2020-02-06 17:20:16 +01:00
|
|
|
will use the helper's `forget` command to remove it.
|