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搭建開發環境網絡

相關文章
相關標籤/搜索