首页 > 解决方案 > 无法使用带有 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],没有支持的方法”

标签: packer

解决方案


推荐阅读