【发布时间】:2016-05-26 23:51:18
【问题描述】:
我正在尝试遵循一个简单的 ssh'ing 过程来描述here 的实例。 不幸的是,我不断收到此错误:
Server refused our key FATAL
ERROR: Disconnected: No supported authentication methods available
(server sent: publickey)
看起来我做的一切都是正确的。
- 我创建了一个新的 ubuntu 实例
- 尝试使用
$ gcloud compute username@ssh example-instance --zone us-central1-a登录 -
收到将要生成 ssh 密钥的警告
WARNING: You do not have an SSH key for Google Compute Engine. WARNING: [C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\winkeygen.exe] will be executed to generate a key. Updated [https://www.googleapis.com/compute/v1/projects/sharp-kayak-120708]. -
我收到上面提到的错误
Server refused our key FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
我看到在本地机器和实例上创建的密钥(gcloud 将它们添加到元数据 -> SSH 密钥)。网络设置中允许使用 SSH。
我尝试了here 描述的替代路线:
- 使用 gcloud 生成 ssh
- 将其添加到选美比赛中
- 使用 PuTTY 进行 SSH
-
同样的错误:
No supported authentication methods available (server sent: publickey)
非常感谢您的想法。
【问题讨论】:
-
你能把
gcloud info的输出贴出来吗?您也可以尝试使用带有--dry-run标志的ssh 命令并发布输出吗? -
@Valentin herelink 是 gcloud info 的输出,这里是 --dry-run 输出
C:\Program Files (x86)\Google\Cloud SDK>gcloud compute ssh --dry-run temp-machine C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\putty.exe -i C:\Users\victo\.ssh\google_compute_engine.ppk victo@104.197.216.86如果我在实例上执行whoami,我会得到不同的登录名。 gcloud 使用的登录名来自 Windows 机器。虽然让我吃惊的是手动添加密钥也无济于事 -
@Valentin 看起来这个问题是特定于平台的——我刚刚在 Mac 机器上重复了所有步骤,并且能够毫无问题地通过 ssh 进入实例。
-
您是否尝试通过 SSH 连接到 Windows 虚拟机? Windows 没有 SSH。
gcloud compute ssh仅适用于 Linux 虚拟机。
标签: ssh google-cloud-platform gcloud