【发布时间】:2016-09-06 21:54:16
【问题描述】:
我已尝试唤醒基础 VM bento/centos-67。
$ vagrant version
Installed Version: 1.8.5
Latest Version: 1.8.5
You're running an up-to-date version of Vagrant!
$ vagrant init bento/centos-6.7; vagrant up --provider virtualbox; vagrant up
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-6.7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/centos-6.7' is up to date...
==> default: Setting the name of the VM: bento_default_1473166306806_14580
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> 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:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
但同时我可以使用vagrant ssh 和密码vagrant。
那么,怎么了?..
相关问题:#1
(也将此问题报告给chef)
修复
问题是:~/.ssh/authorized_keys 文件的公钥具有644 权限但必须是600
$ ssh vagrant@127.0.0.1 -p 2200 # use password "vagrant"
[vagrant@localhost ~]$ chmod 600 ~/.ssh/authorized_keys
现在vagrant ssh无需询问即可使用。
问题是为什么它不能从盒子里工作?出了什么问题?我已经教它如何正确定义authorized_keys 文件? oO
也许这与the vagrant bug有关。
【问题讨论】:
标签: ssh centos vagrant virtualbox