Google 云实例无法通过 Putty 连接 - 正在获取 "Not Supported Authentication Methods Available (server sent : public key)"

Google Cloud Instance Not able to Connect through Putty - Getting "Not Supported Authentication Methods Available (server sent : public key)"

我是 Google Cloud 的新手,但我通过查看一些文档和论坛遵循了以下所有步骤。不确定我是否遗漏了任何配置或什么。任何帮助将不胜感激

不确定发生了什么。我也尝试了来自 Whosebug 和 google 组的其他帖子的所有帮助。但对我来说似乎没有任何改变。可能很简单我不看?

我已尝试按照您的步骤进行操作,但未发现任何问题。

请查看以下命令:

  • 创建测试 VM 实例;

  • download PuTTY 和 PuTTYgen ;

  • 按照documentation生成SSH密钥:

    1. Click Generate and follow the on-screen instructions to generate a new key. For most cases, the default parameters are fine, but you must generate keys with at least 2,048 bits. When you have finished generating the key, the tool displays your public key value.

    2. In the Key comment section, replace the existing text with the username of the user for whom you will apply the key.

    3. Optionally, you can enter a Key passphrase to protect your key.

    4. Click Save private key to write your private key to a file with a .ppk extension.

    5. Click Save public key to write your public key to a file for later use. Keep the PuTTYgen window open for now.

  • 按照文档 Adding or removing project-wide public SSH keys to add public key project wide at the Metadata 页:

    Use project-wide public SSH keys to give users general access to a Linux instance. Project-wide public SSH keys give users access to all of the Linux instances in a project that allow project-wide public SSH keys. If an instance blocks project-wide public SSH keys, a user can't use their project-wide public SSH key to connect to the instance unless the same public SSH key is also added to instance metadata.

    或按照文档 Adding or removing instance-level public SSH keys 在实例级别执行此操作:

    Instance-level public SSH keys give users access to a specific Linux instance. Users with instance-level public SSH keys can access a Linux instance even if it blocks project-wide public SSH keys.

  • 将私钥添加到 PuTTY 并使用您在生成密钥时在 Key comment 部分使用的用户名连接到 VM 实例,I在此步骤中使用任何其他用户名能够重现您的错误

此外,看看 OS Login 功能:

OS Login lets you use Compute Engine IAM roles to grant or revoke SSH access to your Linux instances. OS Login is an alternative to managing instance access by adding and removing SSH keys in metadata.