握手失败:ssh:无法验证,尝试的方法[无密码键盘交互],没有支持的方法仍然存在 [英] handshake failed: ssh: unable to authenticate, attempted methods [none password keyboard-interactive], no supported methods remain
问题描述
这个问题的问题类似于SSH 失败时使用 Packer 构建 RancherOS
但是,我的 Packer 的行为是不同的.我明白了
However, the behavior of my Packer is different. I get
==> virtualbox-iso: Error waiting for SSH: ssh: handshake failed: ssh:
unable to authenticate, attempted methods [none password keyboard-
interactive], no supported methods remain
我不知道为什么 Packer 无法通过 ssh 进入虚拟机.我可以看到 VirtualBox 控制台屏幕位于登录输入上.然后它超时并被打包程序丢弃.
I am not sure why Packer is not able to ssh into the VM. I can see VirtualBox Console Screen sits on a login input. Then it timeouts and gets discarded by packer's process.
packer.json
{
"variables": {
"ros_version" : "v1.1.4",
"iso_md5" : "b1f395a86c7c040702ec77fe87abb2e2",
"vm_name" : "rancher_image"
},
"builders": [
{
"type": "virtualbox-iso",
"iso_url": "https://releases.rancher.com/os/{{ user `ros_version` }}/rancheros.iso",
"guest_os_type": "Linux_64",
"guest_additions_mode": "disable",
"iso_checksum_type": "md5",
"iso_checksum": "{{ user `iso_md5` }}",
"output_directory": "output_rancheros",
"ssh_wait_timeout": "120s",
"shutdown_command": "sudo shutdown -h now",
"disk_size": 8000,
"ssh_username": "rancher",
"ssh_password": "rancher",
"headless" : false,
"ssh_port": 22,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 4444,
"ssh_skip_nat_mapping": true,
"vm_name": "{{ user `vm_name` }}",
"boot_wait": "30s",
"vboxmanage":[
["modifyvm", "{{.Name}}", "--memory","4096"]
]
}
],
"provisioners": [
{
"type":"file",
"source": "cloud-config.yml",
"destination": "/tmp/cloud-config.yml"
},
{
"type": "shell",
"inline": [
"ifconfig",
"sudo ros install -d /dev/sda -f -c /tmp/cloud-config.yml -i rancher/os:{{ user `ros_version` }} --no-reboot"
]
}
]
}
cloud-config.yml
#cloud-config
rancher:
ssh_authorized_keys:
- ssh-rsa AAA ... some VALID RSA email@email.com
network:
interfaces:
eth0:
dhcp: true
dns:
nameservers:
-8.8.8.8
-8.8.4.4
在构建器中添加了这些行,并从供应商中删除了它们的等价物.这仍然没有解决我想要的其他步骤,但至少上传了cloud-config并且可以进行配置.
Added these lines in the builder and removed their equivalents from provisioners. This still does not solve the other steps that I want to have, but at least cloud-config is uploaded and configuration can be done.
"http_directory":"http",
"boot_command":[
"<esc><esc><enter><wait>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/cloud-config.yml <enter>",
"sudo ros install -d /dev/sda -f -c cloud-config.yml -i rancher/os:{{ user `ros_version` }}",
"<enter>"],
推荐答案
RancherOS 默认没有启用 ssh 密码.请参阅问题 #1467
RancherOS doesn't have ssh password enabled by default. See issue #1467
这篇关于握手失败:ssh:无法验证,尝试的方法[无密码键盘交互],没有支持的方法仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!