packer - 无法使用带有 private_key 身份验证的打包程序在 virtualbox 中创建 OVA
问题描述
我无法使用带有 id_rsa 的 virtualbox 中的打包程序创建 OVA。从主机我可以使用相同的私钥 ssh 到 vbox 主机。错误是给定的
“等待 SSH 时出错:ssh:握手失败:ssh:无法验证,尝试的方法 [none publickey],没有支持的方法”。使用 "
ssh_password
" 成功创建了 OVA。但我的目标是使用私钥创建一个 OVA。
{
"builders": [{
"type": "virtualbox-ovf",
"source_path": "/root/Documents/OVA_idrsa.ova",
"ssh_username": "support",
"ssh_private_key_file": "id_rsa",
"ssh_pty": "true",
"ssh_port": 22,
"vrdp_bind_address": "0.0.0.0",
"guest_additions_mode": "disable",
"virtualbox_version_file": "",
"headless": true,
"ssh_skip_nat_mapping": "true",
"boot_wait": "120s",
"ssh_wait_timeout": "1000s",
"shutdown_command": ""
}]
}
我尝试过使用ssh_password
。它是成功的。但是对于 private_key 文件,问题是反复出现的。
{
"builders": [{
"type": "virtualbox-ovf",
"source_path": "/root/Documents/OVA_idrsa.ova",
"ssh_username": "support",
"ssh_private_key_file": "id_rsa",
"ssh_pty": "true",
"ssh_port": 22,
"vrdp_bind_address": "0.0.0.0",
"guest_additions_mode": "disable",
"virtualbox_version_file": "",
"headless": true,
"ssh_skip_nat_mapping": "true",
"boot_wait": "120s",
"ssh_wait_timeout": "1000s",
"shutdown_command": ""
}]
}
错误:
“等待 SSH 时出错:ssh:握手失败:ssh:无法验证,尝试的方法 [none publickey],没有支持的方法”
解决方案
推荐阅读
- macos - Mac Catalyst:如何通过多窗口支持控制 tabbingMode?
- c# - Renci.SshNet 上的错误“/bin/false:没有这样的文件或目录”
- javascript - SecurityError:无法构造'WebSocket,当我在heroku服务器中上传react js应用程序时,本地所有文件都运行良好
- ios - SwiftUI:取消定时器后如何重新启动它?
- python - ValueError:无法将字符串转换为浮点数:'GIAC'
- python - Value Error can not convert string to float
- javascript - 通过添加一个类来更改两个不同规则中存在的 CSS 属性值
- javascript - Travis CI 构建在 react-native android 上失败
- python - 将 python 列表插入 SQLite 数据库
- python - 如何循环两个 python 生成器