To SSH to virtual machine example-instance in project projectA, run:
gdcloud compute ssh example-instance --project projectA
可选标志
--command string A command to run on the virtual machine.
Runs the command on the target instance and then exits. Example:
gcloud compute ssh example-instance --command="ps -ejH"
--ssh-flag stringArray Additional flags to be passed to ssh(1).
It is recommended that flags be passed using an assignment operator and quotes. Example:
gcloud compute ssh example-instance --ssh-flag="-vvv" --ssh-flag="-L 80:localhost:80"
--strict-host-key-checking string Override the default behavior of StrictHostKeyChecking for the connection.
By default, StrictHostKeyChecking is set to 'ask' when '--quiet' is NOT on, otherwise it is set to 'accept-new'.
Must be one of: "yes", "no", "ask", "accept-new". (default "ask")
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe \u003ccode\u003egdcloud compute ssh\u003c/code\u003e command allows users to establish an SSH connection to an air-gapped GDC virtual machine.\u003c/p\u003e\n"],["\u003cp\u003eYou can execute a specific command on the virtual machine using the \u003ccode\u003e--command\u003c/code\u003e flag without needing to open a full SSH session.\u003c/p\u003e\n"],["\u003cp\u003eAdditional SSH flags can be passed to the underlying SSH command via the \u003ccode\u003e--ssh-flag\u003c/code\u003e option for customization.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--strict-host-key-checking\u003c/code\u003e flag offers control over the host key checking behavior during the SSH connection, defaulting to 'ask' unless the quiet option is used.\u003c/p\u003e\n"],["\u003cp\u003eCommon flags like \u003ccode\u003e--project\u003c/code\u003e, \u003ccode\u003e--format\u003c/code\u003e, \u003ccode\u003e--help\u003c/code\u003e, among others, are also available for use with the \u003ccode\u003egdcloud compute ssh\u003c/code\u003e command.\u003c/p\u003e\n"]]],[],null,["# gdcloud compute ssh\n\nNAME\n----\n\ngdcloud compute ssh - SSH to a GDC air-gapped virtual machine.\n\nSYNOPSIS\n--------\n\n gdcloud compute ssh INSTANCE_NAME [flags]\n\n### EXAMPLES\n\n To SSH to virtual machine example-instance in project projectA, run:\n\n gdcloud compute ssh example-instance --project projectA\n\n### OPTIONAL FLAGS\n\n --command string A command to run on the virtual machine.\n Runs the command on the target instance and then exits. Example:\n \n gcloud compute ssh example-instance --command=\"ps -ejH\"\n --ssh-flag stringArray Additional flags to be passed to ssh(1).\n It is recommended that flags be passed using an assignment operator and quotes. Example:\n \n gcloud compute ssh example-instance --ssh-flag=\"-vvv\" --ssh-flag=\"-L 80:localhost:80\"\n --strict-host-key-checking string Override the default behavior of StrictHostKeyChecking for the connection.\n By default, StrictHostKeyChecking is set to 'ask' when '--quiet' is NOT on, otherwise it is set to 'accept-new'.\n Must be one of: \"yes\", \"no\", \"ask\", \"accept-new\". (default \"ask\")\n\n### GDCLOUD WIDE FLAGS\n\nThese flags are available to all commands: `--configuration`, `--format`, `--help`, `--project`, `--quiet`.\n\nFor more information, see the [gdcloud CLI reference overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud) page."]]