vagrant使用总结

一、下载安装vagrant

二、添加虚拟机,如vagrant add box centos/7,固然你也能够下载到本地来添加。

三、添加完成后在指定文件夹内初始化你刚才安装好的box,如我在/Users/zhangwei/Vagrant/centos7下执行命令:vagrant init centos/7,这时候会生成vagrantfile配置文件。

四、初始化完成以后就能够启动了,执行命令:vagrant up

五、添加centos会出现ssh认证问题,添加ubuntu没有这个问题,到如今都不知道怎么解决???


遇到的问题:

$ vagrant up
...
==> centos: Waiting for machine to boot. This may take a few minutes...
    centos: SSH address: 10.211.55.235:22
    centos: SSH username: vagrant
    centos: SSH auth method: private key
    centos: Warning: Connection refused. Retrying...
    centos:
    centos: Vagrant insecure key detected. Vagrant will automatically replace
    centos: this with a newly generated keypair for better security.
    centos:
    centos: Inserting generated public key within guest...
    centos: Removing insecure key from the guest if it's present...
    centos: Key inserted! Disconnecting and reconnecting using new SSH key...
    centos: Warning: Authentication failure. Retrying...
    centos: Warning: Authentication failure. Retrying...
    centos: Warning: Authentication failure. Retrying...
    centos: Warning: Authentication failure. Retrying...
    centos: Warning: Authentication failure. Retrying...
...

解决:

其实我也不知道怎么解决,感受就天然就行了,是否是网络缘由我也不知道,不过在好以前我设置了一下虚拟机的~/.ssh/authorized_keys文件权限为600,以前是644.

参考:html

  1. https://github.com/mitchellh/...git

  2. http://www.cnblogs.com/woshim...github

参考:ubuntu

  1. vagrant系列一:vagrant的安装与初识centos

  2. 使用Homestead搭建开发环境网络

相关文章
相关标签/搜索