github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/website/docs/cli/commands/login.mdx (about)

     1  ---
     2  page_title: 'Command: login'
     3  description: >-
     4    The terraform login command can be used to automatically obtain and save an
     5    API token for Terraform Cloud, Terraform Enterprise, or any other host that
     6    offers Terraform services.
     7  ---
     8  
     9  # Command: login
    10  
    11  The `terraform login` command can be used to automatically obtain and save an
    12  API token for Terraform Cloud, Terraform Enterprise, or any other host that offers Terraform services.
    13  
    14  -> **Note:** This command is suitable only for use in interactive scenarios
    15  where it is possible to launch a web browser on the same host where Terraform
    16  is running. If you are running Terraform in an unattended automation scenario,
    17  you can
    18  [configure credentials manually in the CLI configuration](/cli/config/config-file#credentials).
    19  
    20  ## Usage
    21  
    22  Usage: `terraform login [hostname]`
    23  
    24  If you don't provide an explicit hostname, Terraform will assume you want to
    25  log in to Terraform Cloud at `app.terraform.io`.
    26  
    27  ## Credentials Storage
    28  
    29  By default, Terraform will obtain an API token and save it in plain text in a
    30  local CLI configuration file called `credentials.tfrc.json`. When you run
    31  `terraform login`, it will explain specifically where it intends to save
    32  the API token and give you a chance to cancel if the current configuration is
    33  not as desired.
    34  
    35  If you don't wish to store your API token in the default location, you can
    36  optionally configure a
    37  [credentials helper program](/cli/config/config-file#credentials-helpers) which knows
    38  how to store and later retrieve credentials in some other system, such as
    39  your organization's existing secrets management system.
    40  
    41  ## Login Server Support
    42  
    43  The `terraform login` command works with any server supporting the
    44  [login protocol](/internals/login-protocol), including Terraform Cloud
    45  and Terraform Enterprise.