我正在尝试使用 Vagrant 设置一个小型虚拟集群,其中有一台 Ubuntu 机器和几台 CoreOS 机器。我遇到的问题是我需要在 guest 计算机之间设置 key 身份验证。
我尝试将私钥放入 .ssh/id_rsa
文件并将公钥放入 .ssh/authorized_keys
并使用 config.ssh .private_key_path
但我无法让它工作。
有什么简单的方法可以做到这一点吗?
谢谢。
最佳答案
想通了。我遇到的问题是我设置了自己的 key ,但是 Vagrant boxes 安装了 these keys如果将 config.ssh.private_key_path
设置为自定义 key ,则无法连接。在文档中找到提示 here ,我认为这可能会警告用户,如果他们在使用公共(public)框时尝试覆盖 key ,他们将无法连接:
config.ssh.private_key_path
- The path to the private key to use to SSH into the guest machine. By default this is the insecure private key that ships with Vagrant, since that is what public boxes use. If you make your own custom box with a custom SSH key, this should point to that private key.
所以诀窍是你应该使用 Vagrant 提供的 key ,将它们放在适当的 .ssh/id_rsa
和 .ssh/authorized_keys
插槽中。
关于ubuntu - Vagrant 多机 Inter-SSH key 认证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27005400/