Google Cloud SSH Keys

I installed my new server using the Google Compute Engine. I added the user and their public key to the metadata in the Google Cloud Console ( sshKeys).

I tried replacing the public key in the metadata, but now the old one seems to be the only one who can transfer ssh to my server (using PuTTY). The new one does not seem to be updated.

Now, even if I delete all the metadata or type the text of the time sheet in the field sshKeys, it will still work!

Maybe someday metadata is needed on the server (my previous attempts were instant)?

+4
source share
2 answers

To understand how the Google Compute Engine manages ssh keys, you need to understand how GCE manages metadata (since, as you wrote, they are in the metadata store).

And more specifically, the difference between project and instance metadata is crucial. To quote the documentation (see previous links):

, . , . , , Compute Engine .

, :

[...]

[...], [...], Compute Engine .

, :

  • , .
  • , , .

, GCE / ssh ​​ ( , ~user/.ssh/authorized_keys - ~user) , ( ). , GCE ssh , .

, GCE , , , GCE: sshKeys.

, sshKeys, ssh GCE; .

: , ( ). , , , , , .


:

(, ubuntu) ( ubuntu: ~ubuntu), , ssh , ; authorized_keys GCE. , ssh.


: GCE, terraform Google

+2

sshKeys .

, , . sshKeys " : ssh-rsa AAAAB3Nza..... sjr comment". , .

, sshKeys , , , html.

+1

Source: https://habr.com/ru/post/1541631/


All Articles