vagrant使用总结

1、下载安装vagrant

2、添加虚拟机,如vagrant add box centos/7,当然你也可以下载到本地来添加。

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

4、初始化完成之后就可以启动了,执行命令:vagrant up

5、添加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.

参考:

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

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

参考:

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

  2. 使用Homestead搭建开发环境

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值