Score:0

Unable to connect to gcp using ssh from command terminal (windows machine)

ao flag

Initially ran the below command in terminal.

gcloud compute ssh --project="pret-registry" --zone="us-east1-b" "pretlist-hw-server" --tunnel-through-iap --dry-run

Output of the above command

ssh -t -i C:\Users\Administrator.ssh\google_compute_engine -o CheckHostIP=no -o HashKnownHosts=no -o HostKeyAlias=compute.1900385377936815063 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\Administrator.ssh\google_compute_known_hosts -o "ProxyCommand C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe -S "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\gcloud.py" compute start-iap-tunnel pretlist-hw-server %p --listen-on-stdin --project=pret-registry --zone=us-east1-b --verbosity=warning" [email protected]

Tried running the above command in my terminal and got the below error.

C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe: can't open file 'C:\Program': [Errno 2] No such file or directory kex_exchange_identification: Connection closed by remote host

If I navigate to C:\Program Files (x86)\Google\Cloud SDK in my terminal and run the below command (replaced the aforementioned path with "."), then the connection goes through.

ssh -t -i C:\Users\Administrator.ssh\google_compute_engine -o CheckHostIP=no -o HashKnownHosts=no -o HostKeyAlias=compute.1900385377936815063 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\Administrator.ssh\google_compute_known_hosts -o "ProxyCommand .\google-cloud-sdk\platform\bundledpython\python.exe -S ".\google-cloud-sdk\lib\gcloud.py" compute start-iap-tunnel pretlist-hw-server %p --listen-on-stdin --project=pret-registry --zone=us-east1-b --verbosity=warning" [email protected]

Need this ssh to work with full path since I want to connect to gcp from vs code.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.