Home  >  Article  >  Backend Development  >  Vagrant Notes

Vagrant Notes

WBOY
WBOYOriginal
2016-07-29 09:07:001353browse

Authentication failed when importing box files with vagrant

<code> default: SSH auth method: private key
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Authentication failure. Retrying...
</code>

I searched for 2 methods online

<code>编辑Vagrantfile
在里面添加
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
使用用户名和密码登录之后,里面的login key会重设置
启动登录后,关掉虚拟机, 注释
# config.ssh.username = "vagrant"
# config.ssh.password = "vagrant"
</code>
<code>a.打开终端 输入 ssh-keygen
然后系统提示输入文件保存位置等信息,连续敲三次回车即可,生成的SSH key文件保存在中~/.ssh/id_rsa;
b.ssh-add ~/.ssh/id_rsa 添加到证书列表;
c.在Vagrantfile文件添加
config.ssh.private_key_path = “~/.ssh/id_rsa”
config.ssh.forward_agent = true
用于vagrant ssh连接认证
d.在虚拟机~/.ssh/authorized_keys文件中追加本地机器”~/.ssh/id_rsa.pub”文件里面的内容;
e.vagant reload重启虚拟机就可以正常连接了</code>

The above introduces the Vagrant notes, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn