【问题标题】:Error waiting for SSH: Packer experienced an authentication error : using vsphere-iso等待 SSH 时出错:Packer 遇到身份验证错误:使用 vsphere-iso
【发布时间】:2022-10-26 00:40:16
【问题描述】:

使用 vsphere-iso builder 运行打包程序时出现以下错误。

Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password keyboard-interactive], no supported methods remain

配置文件

    "communicator": "ssh",
    "ssh_username": "{{user `ssh_username`}}",
    "ssh_password": "{{user `ssh_password`}}",
    "ssh_timeout": "30m",

用户名和密码在运行时来自 Jenkins。同样已更新自动无人值守.xml,如果我在 config.json 文件中对凭证进行硬编码,那么它工作正常。不知道是什么问题

打包程序调试日志

2022/05/09 10:16:20 packer.exe plugin: [DEBUG] Detected authentication error. Increasing handshake attempts.
2022/05/09 10:16:27 packer.exe plugin: [INFO] Attempting SSH connection to 172.16.112.59:22...
2022/05/09 10:16:27 packer.exe plugin: [DEBUG] reconnecting to TCP connection for SSH
2022/05/09 10:16:27 packer.exe plugin: [DEBUG] handshaking with SSH
2022/05/09 10:16:28 packer.exe plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password keyboard-

【问题讨论】:

    标签: jenkins ssh packer hashicorp-packer packer-builder


    【解决方案1】:

    我得到了如下解决方案

    自动无人值守.xml文件密码以纯文本形式给出 true ,需要将其更改为 false。

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题。如果我在下面的代码中将 true 更改为 false,我的自动无人参与就会中断。

                          <LocalAccount wcm:action="add">
                              <Password>
                                  <Value>__ELEVATEDPASSWORD__</Value>
                                  <PlainText>true</PlainText>
                              </Password>
                              <Group>administrators</Group>
                              <DisplayName>LocalAdminUser</DisplayName>
                              <Name>TempLocalAdminUser</Name>
                              <Description>Temp Admin User</Description>
                          </LocalAccount>                <LocalAccounts>
                          <LocalAccount wcm:action="add">
                              <Password>
                                  <Value>__ELEVATEDPASSWORD__</Value>
                                  <PlainText>true</PlainText>
                              </Password>
                              <Group>administrators</Group>
                              <DisplayName>DevOpsConfig</DisplayName>
                              <Name>DevOpsConfig</Name>
                              <Description>Dev Ops User</Description>
                          </LocalAccount>
      

      我错过了什么吗?我只是将&lt;PlainText&gt;true&lt;/PlainText&gt; 更改为&lt;PlainText&gt;false&lt;/PlainText&gt;

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-06
        • 2013-05-23
        • 2016-09-05
        • 2012-02-14
        • 2018-01-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多