authnone_create - Linux


Overview

authnone_create is a command that creates a service account with no authentication mechanism configured. This type of service account is commonly used in scenarios where the service account does not require any form of authentication, such as when the service account is used to access resources within the same project or when the service account is used in a trusted environment.

Syntax

authnone_create [--display-name DISPLAY_NAME] [--project-id PROJECT_ID] [--service-account-file SERVICE_ACCOUNT_FILE] [--verbose]

Options/Flags

  • --display-name: The display name of the service account to be created.
  • --project-id: The project ID or number of the project to create the service account in. The project ID is required if the service account is being created in a project other than the current project.
  • --service-account-file: The file path where the service account credentials will be written to. If this option is not specified, the credentials will be written to the default location (~/.google/credentials/serviceaccount.json).
  • --verbose: Print additional information about the service account creation process.

Examples

Create a service account with no authentication configured:

authnone_create --display-name "My Service Account" --project-id "my-project"

Create a service account with no authentication configured and specify the service account file path:

authnone_create --display-name "My Service Account" --project-id "my-project" --service-account-file "/path/to/my-service-account.json"

Common Issues

If you encounter the following error when creating a service account:

google.rpc.Code.PERMISSION_DENIED: The caller does not have permission

Ensure that you have the necessary permissions to create service accounts in the project.

Integration

authnone_create can be combined with other commands, such as gcloud auth activate-service-account, to activate the service account and access resources in the project. For example:

gcloud auth activate-service-account --key-file /path/to/my-service-account.json

Related Commands