当我在我的应用程序中运行vagrant up时,进程停滞不前
SSH auth method: private keyVagrantfile
Vagrant.configure(2) do |config|
config.vm.define :touch_rugby do |app_config|
app_config.vm.box = "bento/ubuntu-16.04"
app_config.vm.host_name = "touchrugby"
app_config.vm.network "private_network", ip: "33.32.1.2"
app_config.ssh.insert_key = true
end
end在另一个窗口中运行vagrant ssh-config时
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/rich/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATALinsecure_private_key从何而来?它不应该是一个private_key吗
我可以查看什么来尝试和调试它?我在调试模式下运行流浪,发现了这个
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: 127.0.0.1
INFO ssh: - Port: 2222
INFO ssh: - Username: vagrant
INFO ssh: - Password? false
INFO ssh: - Key Path: ["/Users/rich/.vagrant.d/insecure_private_key"]
DEBUG ssh: - connect_opts: {:auth_methods=> ["none "hostbased""publickey"],
:config=>false,
:forward_agent=>false,
:send_env=>false,
:keys_only=>true,
:paranoid=>false,
:password=>nil,
:port=>2222,
:timeout=>15 }
INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "1f000e35-eee4-482d-8f76-91082f19c2ab", "--machinereadable"]有没有人对我能做什么有什么进一步的想法?
谢谢
发布于 2017-02-22 04:24:17
如果ssh.insert_key属性设置为true,那么您在/Users/rich/.vagrant.d/insecure_private_key看到的私钥是由vagrant生成的。
Looking at the documentation,您应该能够使用指定现有私钥的位置。
config.ssh.private_key_path
The path to the private key to use to SSH into the guest machine. By default this is the insecure private key that ships with Vagrant, since that is what public boxes use. If you make your own custom box with a custom SSH key, this should point to that private key.发布于 2017-02-23 09:39:28
正常情况下,Vagrant将自动使用一个公共的、“众所周知的”ssh密钥,并自动将虚拟盒子设置为使用该密钥。要获得这种行为,只需在Vagrantfile中设置app_config.ssh.insert_key = true选项即可。
我们在Vagrantfile中设置了这两个选项,因为我们没有使用默认的vagrant帐户,但是为了更好地模拟我们的ec2-user环境,我们创建了一个ssh帐户并指定了我们自己的私有ssh密钥。
config.ssh.username = "ec2-user"
config.ssh.private_key_path = "/Users/lance/git/devops/.vagrant_helpers/vagrant_private_key"https://stackoverflow.com/questions/42377047
复制相似问题