Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

后端 未结 11 1148
有刺的猬
有刺的猬 2020-12-04 16:42

After creating the instance, I can login using gcutil or ssh. I tried copy/paste from the ssh link listed at the bottom of the instance and get the same error message.

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 17:17

    The trick here is to use the -C (comment) parameter to specify your GCE userid. It looks like Google introduced this change last in 2018.

    If the Google user who owns the GCE instance is myname@gmail.com (which you will use as your login userid), then generate the key pair with (for example)

    ssh-keygen -b521 -t ecdsa -C myname -f mykeypair
    

    When you paste mykeypair.pub into the instance's public key list, you should see "myname" appear as the userid of the key.

    Setting this up will let you use ssh, scp, etc from your command line.

提交回复
热议问题