首页 > Linux教程 > 正文

解决Vagrant报错Warning: Authentication failure. Retrying问题

vagrant报错,提示Warning: Authentication failure. Retrying...,重试多次后失败, 并且运行完毕后没有共享文件夹

提示信息如下:

default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.


通过上面的错误信息,我们发现并不是config.vm.boot_timeout的问题, 因为我们已经可以连接虚拟机了。 Authentication failure说明认证失败, 猜测可能是ssh默认登陆问题, 简单的处理方法:


在Vagrantfile配置文件中添加了两行代码,使用明文用户名密码

注意: 如果你改过vagrant的密码,那么请填写改后的正确密码。

config.ssh.username = "vagrant"
config.ssh.password = "vagrant"

保存


vagrant reload


发现问题解决啦!证明我的猜测是对的


上一篇:Linux下文件的切分与合并的简单方法
下一篇:Linux 目录与权限详解

PythonTab微信公众号:

Python技术交流互助群 ( 请勿加多个群 ):

群1: 87464755

群2: 333646237

群3: 318130924

群4: 385100854