azure - 无法连接两个 Azure 虚拟机 - 权限被拒绝(公钥)

标签 azure permissions virtual-machine virtual

我正在尝试连接两个 Microsoft Azure 虚拟机。两者都位于同一虚拟网络上。当我尝试使用 ssh 连接时,终端返回权限被拒绝(公钥)。想一想为什么我会收到此错误?我尝试检查我的网络入站/出站端口规则,虚拟网络上没有防火墙。

所以我的问题不在于我的机器和虚拟机之间的连接,这工作正常。我无法在两个虚拟机之间使用 ssh 连接。

最佳答案

看看这个描述:

When you use an SSH client to connect to your Linux VM (which has the public key), the remote VM tests the client to make sure it possesses the private key. If the client has the private key, it's granted access to the VM.

问题似乎出在您的公钥上。使用公钥创建 Azure VM 时,应确保公钥也位于您的主目录中,例如 ~/.ssh/。这意味着您的本地计算机和虚拟机都存储了公钥。然后,您可以使用公钥通过本地计算机接受的权限来 ssh 您的 Azure VM。可以看到步骤How to create the VM with a public key .

关于azure - 无法连接两个 Azure 虚拟机 - 权限被拒绝(公钥),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54281307/

相关文章:

azure - 我的 Azure ML api 其余部分返回一个空对象

image - 使用 terraform 从镜像创建 azure vm

azure - 正确的 azure keyvault 配置

ios - 使用 ACAccount for Facebook iOS 7 获取电子邮件

.net - 为什么 IO.Directory.CreateDirectory 不应该成功?

ruby - 如何在不删除对外部 API 的访问的情况下为 ruby​​ 设置虚拟环境或沙箱?

macos - 更改 VirtualBox 的 MacOS X 访客屏幕分辨率

ubuntu - 启动 Raise 网络接口(interface)失败

azure - 在 Azure 容器应用程序上运行一次性作业

asp.net-mvc - 部署 azure 应用程序