尽管SSH配置正确,但SSH进入GCE实例仍然失败

时间:2018-04-20 20:16:32

标签: ssh google-cloud-platform google-compute-engine gcloud

我正在尝试使用gcompute ssh通过SSH连接到GCE实例。到目前为止,我似乎完成了一切,但是当我跑步时

gcloud compute ssh --zone "us-central1-b" --project "projectname" "instancename" --ssh-flag="-v" 

我得到了

  

debug1:读取配置数据/ etc / ssh / ssh_config

     

debug1:/ etc / ssh / ssh_config第48行:应用*

的选项      

debug1:连接到104.XXX.XXX.XXX端口22。

     

debug1:已建立连接。

     

debug1:身份文件/Users/myusername/.ssh/google_compute_engine type 0

     

debug1:key_load_public:没有这样的文件或目录

     

debug1:身份文件/Users/myusername/.ssh/google_compute_engine-cert type -1

     

debug1:本地版本字符串SSH-2.0-OpenSSH_7.6

     

debug1:远程协议版本2.0,远程软件版本OpenSSH_5.3

     

debug1:匹配:OpenSSH_5.3 pat OpenSSH_5 * compat 0x0c000000

     

debug1:以“myusername”身份验证104.XXX.XXX.XXX:22

     

debug1:使用hostkeyalias:compute.1694426511137997XXXX

     

debug1:发送了SSH2_MSG_KEXINIT

     

debug1:收到SSH2_MSG_KEXINIT

     

debug1:kex:algorithm:diffie-hellman-group-exchange-sha256

     

debug1:kex:主机密钥算法:ssh-rsa

     

debug1:kex:server->客户端密码:aes128-ctr MAC:umac-64@openssh.com   压缩:无

     

debug1:kex:client->服务器密码:aes128-ctr MAC:umac-64@openssh.com compression:none

     

debug1:发送了SSH2_MSG_KEX_DH_GEX_REQUEST(2048< 3072< 8192)

     

debug1:获得了SSH2_MSG_KEX_DH_GEX_GROUP

     

debug1:SSH2_MSG_KEX_DH_GEX_INIT已发送

     

debug1:得到了SSH2_MSG_KEX_DH_GEX_REPLY

     

debug1:服务器主机密钥:ssh-rsa   SHA256:CYFI + CPP + T4kyOTSjoe80CUgt0GL3tXisLch / 8axxx

     

debug1:使用hostkeyalias:compute.1694426511137997XXXX   debug1:主机'compute.1694426511137997XXXX'已知并与RSA主机密钥匹配。

     

debug1:找到/Users/myusername/.ssh/google_compute_known_hosts:1中的密钥

     

debug1:429496XXXX阻止后的重定密钥

     

debug1:发送了SSH2_MSG_NEWKEYS

     

debug1:期待SSH2_MSG_NEWKEYS

     

debug1:收到SSH2_MSG_NEWKEYS

     

debug1:在4294967296块之后重新加密

     

debug1:收到SSH2_MSG_SERVICE_ACCEPT

     

debug1:可以继续的身份验证:publickey,gssapi-keyex,gssapi-with-mic

     

debug1:下一个身份验证方法:publickey

     

debug1:提供公钥:RSA   SHA256:rP2W5aPDGoUEqYu0XYUaTuqUZ7 / FqRTTuc3HOWaXxxx /Users/myusername/.ssh/google_compute_engine

     

debug1:可以继续的身份验证:publickey,gssapi-keyex,gssapi-with-mic

     

debug1:不再需要尝试验证方法。   myusername@104.XXX.XXX.XXX:权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic)。

     

错误:(gcloud.compute.ssh)[/ usr / bin / ssh]退出并返回代码[255]。

这是我到目前为止所尝试的内容

  1. 从项目元数据页面删除了我的SSH密钥
  2. 计算实例设置为从项目继承SSH密钥,因此实例的SSH页面无需更改
  3. 我使用我的帐户使用'gcloud auth login'再次通过Gcloud进行身份验证。
  4. 然后我做了'gcloud init'再次设置配置,默认项目和时区
  5. 使用“gcloud compute firewall-rules list”
  6. 验证端口22上的防火墙是否已打开
  7. 使用'ssh-keygen -t rsa -f~ / .ssh / google_compute_engine -C myusername'
  8. 续订我的rsa公钥
  9. 使用'gcloud compute ssh svuppala @ instancename'
  10. 使用新公钥更新了gcloud元数据
  11. https://console.cloud.google.com/compute/metadata/sshKeys?project=xxx
  12. 验证了相同内容
  13. 重新安装gcloud sdk并再次执行上述步骤
  14. 我从未直接向实例添加任何键
  15. 我似乎已经筋疲力尽了。任何帮助都非常感谢!

0 个答案:

没有答案