Skip to content

still have ssh connection issue when building image using centos stream 9 base image with the latest packer/packer-plugin-alicloud #137

Open
@hc-github-team-packer

Description

@hc-github-team-packer

This issue was originally opened by @Forrest2023github in hashicorp/packer#12896 and has been migrated to this repository. The original issue description is below.


Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

1, very similar to hashicorp/packer#11656, but on alicloud
2, tried with "temporary_key_pair_type": "ed25519" as well
it seems the packer-plugin-alicloud does support "temporary_key_pair_type" - https://developer.hashicorp.com/packer/integrations/hashicorp/alicloud/latest/components/builder/alicloud-ecs

Packer version

1.10.2

Packer alicloud plugin version

1.1.1

Simplified Packer Template

"builders":[
{
"name": "alicloud-ecs-centos-stream9",
"type": "alicloud-ecs",
"temporary_key_pair_type": "ed25519",
"access_key": "xxxxxxxxxxxxxxxx",
"secret_key": "xxxxxxxxxxxx",
"source_image": "xxxxxxxxxxxxxx",
"instance_type": "ecs.sn1.medium",
"region": "us-east-1",
"image_name": "xxxxxxxxxxxxxxx",
"image_force_delete": "true",
"instance_name": "xxxxxxxxxxx",
"internet_charge_type": "PayByTraffic",
"io_optimized": "true",
"ssh_username": "root"
}
]

Log Fragments and crash.log files

............
00:25:43  ==> alicloud-ecs.alicloud-ecs-centos-stream9: Using SSH communicator to connect:
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [INFO] Waiting for SSH, up to timeout: 5m0s
00:25:43  ==> alicloud-ecs.alicloud-ecs-centos-stream9: Waiting for SSH to become available...
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [INFO] Attempting SSH connection to :22...
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [DEBUG] reconnecting to TCP connection for SSH
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [DEBUG] handshaking with SSH
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:25:43  2024/03/21 00:25:43 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:43 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:25:50  2024/03/21 00:25:50 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:50 [INFO] Attempting SSH connection to :22...
00:25:50  2024/03/21 00:25:50 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:50 [DEBUG] reconnecting to TCP connection for SSH
00:25:50  2024/03/21 00:25:50 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:50 [DEBUG] handshaking with SSH
00:25:50  2024/03/21 00:25:50 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:50 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:25:50  2024/03/21 00:25:50 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:50 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:25:57  2024/03/21 00:25:57 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:57 [INFO] Attempting SSH connection to :22...
00:25:57  2024/03/21 00:25:57 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:57 [DEBUG] reconnecting to TCP connection for SSH
00:25:57  2024/03/21 00:25:57 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:57 [DEBUG] handshaking with SSH
00:25:57  2024/03/21 00:25:57 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:57 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:25:57  2024/03/21 00:25:57 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:25:57 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:04  2024/03/21 00:26:04 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:04 [INFO] Attempting SSH connection to :22...
00:26:04  2024/03/21 00:26:04 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:04 [DEBUG] reconnecting to TCP connection for SSH
00:26:04  2024/03/21 00:26:04 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:04 [DEBUG] handshaking with SSH
00:26:04  2024/03/21 00:26:04 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:04 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:04  2024/03/21 00:26:04 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:04 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:11  2024/03/21 00:26:11 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:11 [INFO] Attempting SSH connection to :22...
00:26:11  2024/03/21 00:26:11 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:11 [DEBUG] reconnecting to TCP connection for SSH
00:26:11  2024/03/21 00:26:11 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:11 [DEBUG] handshaking with SSH
00:26:11  2024/03/21 00:26:11 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:11 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:11  2024/03/21 00:26:11 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:11 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:18  2024/03/21 00:26:18 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:18 [INFO] Attempting SSH connection to :22...
00:26:18  2024/03/21 00:26:18 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:18 [DEBUG] reconnecting to TCP connection for SSH
00:26:18  2024/03/21 00:26:18 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:18 [DEBUG] handshaking with SSH
00:26:18  2024/03/21 00:26:18 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:18 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:18  2024/03/21 00:26:18 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:18 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:25  2024/03/21 00:26:25 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:25 [INFO] Attempting SSH connection to :22...
00:26:25  2024/03/21 00:26:25 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:25 [DEBUG] reconnecting to TCP connection for SSH
00:26:25  2024/03/21 00:26:25 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:25 [DEBUG] handshaking with SSH
00:26:25  2024/03/21 00:26:25 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:25 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:25  2024/03/21 00:26:25 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:25 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:32  2024/03/21 00:26:32 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:32 [INFO] Attempting SSH connection to :22...
00:26:32  2024/03/21 00:26:32 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:32 [DEBUG] reconnecting to TCP connection for SSH
00:26:32  2024/03/21 00:26:32 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:32 [DEBUG] handshaking with SSH
00:26:32  2024/03/21 00:26:32 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:32 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:32  2024/03/21 00:26:32 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:32 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:39  2024/03/21 00:26:39 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:39 [INFO] Attempting SSH connection to :22...
00:26:39  2024/03/21 00:26:39 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:39 [DEBUG] reconnecting to TCP connection for SSH
00:26:39  2024/03/21 00:26:39 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:39 [DEBUG] handshaking with SSH
00:26:39  2024/03/21 00:26:39 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:39 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:39  2024/03/21 00:26:39 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:39 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:46  2024/03/21 00:26:46 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:46 [INFO] Attempting SSH connection to :22...
00:26:46  2024/03/21 00:26:46 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:46 [DEBUG] reconnecting to TCP connection for SSH
00:26:46  2024/03/21 00:26:46 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:46 [DEBUG] handshaking with SSH
00:26:46  2024/03/21 00:26:46 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:46 [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
00:26:46  2024/03/21 00:26:46 packer-plugin-alicloud_v1.1.1_x5.0_linux_amd64 plugin: 2024/03/21 00:26:46 [DEBUG] Detected authentication error. Increasing handshake attempts.
00:26:46  ==> alicloud-ecs.alicloud-ecs-centos-stream9: 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 publickey], no supported methods remain
........
........

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions