我想为可能Vagrant VM启用密码ssh身份验证(并启用基于密钥的身份验证).怎么设置?
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "fedora/26-cloud-base"
config.vm.box_version = "20170705"
config.ssh.username = 'vagrant'
config.ssh.password = 'a'
config.ssh.keys_only = false
end
Run Code Online (Sandbox Code Playgroud)
$ sudo vagrant ssh-config
Host default
HostName 192.168.121.166
User vagrant
Port 22
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/jakub/src/kubernetes-vms/kubernetes/.vagrant/machines/default/libvirt/private_key
LogLevel FATAL
Run Code Online (Sandbox Code Playgroud)
a此设置不接受密码.
我想可能是PasswordAuthentication no在输出中vagrant ssh-config.如何打开该选项?
我为CentOS 6.6制作了我的自定义流浪盒.我的问题是为什么当我第一次"迷失"时,流浪汉总是需要密码.这是控制台日志:
$ vagrant up
Bringing machine 'ns' up with 'virtualbox' provider...
==> ns: Clearing any previously set forwarded ports...
==> ns: Clearing any previously set network interfaces...
==> ns: Preparing network interfaces based on configuration...
ns: Adapter 1: nat
ns: Adapter 2: hostonly
==> ns: Forwarding ports...
ns: 22 => 2222 (adapter 1)
==> ns: Running 'pre-boot' VM customizations...
==> ns: Booting VM...
==> ns: Waiting for machine to boot. This may take a few minutes...
ns: SSH address: …Run Code Online (Sandbox Code Playgroud)