how does a google cloud compute generated SSH key lookup the VPS instance?

If I manually create a key, rather than using the gcloud CLI console, can I also configure the public key so that it will look-up the connection as this config seemingly does:

[email protected]:~$  [email protected]:~$ cat .ssh/config  # Google Compute Engine Section # # The following has been auto-generated by "gcloud compute config-ssh" # to make accessing your Google Compute Engine virtual machines easier. # # To remove this blob, run: # #   gcloud compute config-ssh --remove # # You can also manually remove this blob by deleting everything from # here until the comment that contains the string "End of Google Compute # Engine Section". # # You should not hand-edit this section, unless you are deleting it. # Host <instance>.<location>.<project>     HostName <ip address>     IdentityFile /home/thufir/.ssh/google_compute_engine     UserKnownHostsFile=/home/thufir/.ssh/google_compute_known_hosts     HostKeyAlias=compute.<####>     IdentitiesOnly=yes     CheckHostIP=no  # End of Google Compute Engine Section [email protected]:~$  [email protected]:~$ ll .ssh total 80 drwx------  2 thufir thufir  4096 Jul 28 04:00 ./ drwx------ 69 thufir thufir 36864 Jul 28 04:03 ../ -rw-------  1 thufir thufir   799 Jul 28 04:00 config -rw-------  1 thufir thufir  1675 Jul 28 04:00 google_compute_engine -rw-r--r--  1 thufir thufir   395 Jul 28 04:00 [email protected]:~$  

In particular, the HostName <ip address> line is what allows ssh <instance>.<location>.<project>?

The lookup is not established through DNS?

see sort-of related question:

How do I append a SSH key with JSON for Google cloud compute VPS?


In particular, the HostName line is what allows ssh <instance>.<location>.<project>?

Yes. If your ssh config has a HostName <ip address> line for a particular Host somealias stanza, then DNS is not used when you ssh somealias.

Note that it is also possible to specify a FQDN for the HostName

Host abc

in which case DNS is used, but on the HostName, not on the Host alias. However, not relevant to your setup.

Category: ssh Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 5.154 (s). 13 q(s)