Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



gcloud compute config-ssh

NAME
gcloud-compute-config-ssh - Populate SSH config files with Host entries from each instance
SYNOPSIS
gcloud compute config-ssh
  [--dry-run]
  [--format FORMAT]
  [--help]
  [--project PROJECT]
  [--quiet, -q]
  [--remove]
  [--ssh-config-file SSH_CONFIG_FILE]
  [--ssh-key-file SSH_KEY_FILE]
  [-h]
DESCRIPTION
gcloud compute config-ssh makes SSHing to virtual machine instances easier by adding an alias for each instance to the user SSH configuration (“~/.ssh/config”) file.
In most cases, it’s sufficient to run:
gcloud compute config-ssh
Each instance will be given an alias of the form “NAME.ZONE.PROJECT”. For example, if “my-instance” resides in “us-central2-a”, you can SSH to it by running:
ssh my-instance.us-central2-a.my-project
On some platforms, the host alias can be tab-completed, making the long alias less daunting to type.
The aliases created interface with SSH-based programs like scp(1) , so it’s possible to use the aliases elsewhere:
scp ~/my-file my-instance.us-central2-a.my-project:~
Whenever instances are added, removed, or their external IP addresses are changed, this command should be re-executed to update the configuration.
FLAGS
--dry-run
If provided, the proposed changes to the SSH config file are printed to standard out and no actual changes are made.
--format FORMAT
Specify a format for printed output. By default, a command-specific human-friendly output format is used. Setting this flag to one of the available options will serialize the result of the command in the chosen format and print it to stdout. Supported formats are: "json", "text", "yaml".
--help
Display detailed help.
--project PROJECT
Google Cloud Platform project to use for this invocation.
--quiet
Disable all interactive prompts when running gcloud commands. If input is required, defaults will be used, or an error will be raised.
--remove
If provided, any changes made to the SSH config file by this tool are reverted.
--ssh-config-file SSH_CONFIG_FILE
Specifies an alternative per-user SSH configuration file. By default, this is “~/.ssh/config”.
--ssh-key-file SSH_KEY_FILE
The path to the SSH key file. By deault, this is “~/.ssh/google_compute_engine”.
-h
Print a summary help and exit.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.