gcloud_compute_connect-to-serial-port (1)
NAME
- gcloud compute connect-to-serial-port - connect to the serial port of an instance
SYNOPSIS
-
gcloud compute connect-to-serial-port [USER@]INSTANCE [--dry-run] [--extra-args=KEY=VALUE,[KEY=VALUE,...]] [--force-key-file-overwrite] [--port=PORT; default=1] [--ssh-key-file=SSH_KEY_FILE] [--zone=ZONE] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
gcloud compute connect-to-serial-port allows users to connect to, and
The user must first enable serial port access to a given VM by setting the 'serial-port-enable=true' metadata key-value pair. Setting 'serial-port-enable' on the project-level metadata enables serial port access to all VMs in the project.
This command uses the same SSH key pair as the gcloud compute ssh command and also ensures that the user's public SSH key is present in the project's metadata. If the user does not have a public SSH key, one is generated using ssh-keygen.
POSITIONAL ARGUMENTS
-
- [USER@]INSTANCE
-
Specifies the user/instance for the serial port connection.
USER specifies the username to authenticate as. If omitted, the current OS user is selected.
FLAGS
-
- --dry-run
-
If provided, the ssh command is printed to standard out rather than being
executed.
- --extra-args=KEY=VALUE,[KEY=VALUE,...]
-
Optional arguments can be passed to the serial port connection by passing
key-value pairs to this flag, such as max-connections=N or replay-lines=N.
See
cloud.google.com/compute/docs/instances/interacting-with-serial-console
for additional options.
- --force-key-file-overwrite
-
If enabled, the gcloud command-line tool will regenerate and overwrite the
files associated with a broken SSH key without asking for confirmation in both
interactive and non-interactive environments.
If disabled, the files associated with a broken SSH key will not be regenerated and will fail in both interactive and non-interactive environments.
- --port=PORT; default=1
-
The number of the requested serial port. Can be 1-4, default is 1.
Instances can support up to four serial ports. By default, this command will connect to the first serial port. Setting this flag will connect to the requested serial port.
- --ssh-key-file=SSH_KEY_FILE
-
The path to the SSH key file. By default, this is
~/.ssh/google_compute_engine.
- --zone=ZONE
-
Zone of the instance to connect to. If not specified and the
compute/zone property isn't set, you may be prompted to select a
zone.
To avoid prompting when this flag is omitted, you can set the compute/zone property:
- $ gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
- $ gcloud compute zones list
To unset the property, run:
- $ gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
NOTES
These variants are also available:
- $ gcloud alpha compute connect-to-serial-port $ gcloud beta compute connect-to-serial-port