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"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003egdcloud compute ssh\u003c/code\u003e facilitates SSH access to a GDCH virtual machine.\u003c/p\u003e\n"],["\u003cp\u003eThe command requires the \u003ccode\u003eINSTANCE_NAME\u003c/code\u003e as a primary argument.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--command\u003c/code\u003e flag allows execution of a command on the remote virtual machine.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--ssh-flag\u003c/code\u003e option enables passing additional flags to the underlying \u003ccode\u003essh(1)\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--project\u003c/code\u003e flag specifies the project ID of the target virtual machine.\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/appliance/resources/gdcloud-reference/gdcloud) page."]]