【发布时间】:2014-05-03 19:16:51
【问题描述】:
我不想使用“vagrant”用户名和密码 ssh-ing 到我的 Vagrant 虚拟机,而是使用 kevin/kevin。
我修改了我的Vagrantfile 以包括:
config.ssh.username = "kevin"
然后,我跑了vagrant reload。
出现以下输出:
[default] Waiting for machine to boot. This may take a few minutes...
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. This can
mean a number of things.
但是,我仍然可以使用vagrant/vagrant ssh 到我的 vagrant box,但我无法使用 kevin/kevin 或 kevin/vagrant 的用户名和密码 ssh 到这个 box。
请注意,我也尝试了这个答案 (https://stackoverflow.com/a/9924122/409976),但我只能使用用户名 vagrant SSH 到盒子上,而不是 kevin(即使它在 Vagrantfile 中指定)。
如何配置我的 Vagrantfile 以便我可以使用用户名 kevin 进行 ssh?
【问题讨论】:
-
如果您可以使用
vagrant登录自己,但不能使用 Kevin,那么听起来您需要在访客映像中设置kevin用户。Vagrantfile配置只设置用户使用,不设置guest用户。