[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-22 (世界標準時間)。"],[],[],null,["# Choose an access method to log in to clusters\n=============================================\n\nThis document is for developers and other GKE cluster users who need to log in to clusters from the command line using GKE Identity Service.\n\nBefore you begin\n----------------\n\n- Log in from the command line\n\n Logging in to clusters with GKE Identity Service from the command line requires running `gcloud` authentication commands. If you want to use one of the command line login options, do the following:\n 1. Ensure that you have the following command line tools installed:\n\n - The latest version of the Google Cloud CLI, which includes `gcloud`, the command line tool for interacting with Google Cloud. If you need to install the Google Cloud CLI, see the [installation guide](/sdk/docs/install).\n - `kubectl` for running commands against Kubernetes clusters. If you need to install `kubectl`, see the [installation guide](/kubernetes-engine/docs/how-to/cluster-access-for-kubectl).\n 2. Run the following commands to install or update the `anthos-auth` component:\n\n ```\n gcloud components update\n gcloud components install anthos-auth\n ```\n 3. Verify that the component was installed successfully by running the following command:\n\n ```\n gcloud anthos auth version\n ```\n\n If a version is returned, your installation was successful.\n- Log in from the Google Cloud console\n\n For OIDC and AzureAD providers only, you can also log in to clusters from the Google Cloud console without a configuration file or FQDN. For more information, see [Work with clusters from the Google Cloud console](/kubernetes-engine/fleet-management/docs/console).\n\nAccess methods to log in to clusters\n------------------------------------\n\nTo log in to your configured clusters, use one of the following access methods:\n\n- **Log in from the command line with FQDN access** : If you need to log in to your clusters using a fully qualified domain name, see [FQDN access](/kubernetes-engine/enterprise/identity/setup/authenticate-fqdn-access).\n- **Log in from the command line with file-based access** : If you need to log in to your clusters with a configuration file, see [file-based access](/kubernetes-engine/enterprise/identity/setup/authenticate-file-access)."]]