Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer SSH communicator ssh_port argument value is ignored #77

Open
mschuchard opened this issue Sep 8, 2022 · 1 comment
Open

Packer SSH communicator ssh_port argument value is ignored #77

mschuchard opened this issue Sep 8, 2022 · 1 comment
Labels

Comments

@mschuchard
Copy link

mschuchard commented Sep 8, 2022

Overview of the Issue

When specifying a value for the argument ssh_port, the argument value is ignored, and instead the port is chosen from the range specified by host_port_min and host_port_max is selected. I have repeated this multiple times to verify the behavior.

Reproduction Steps

packer build

Plugin and Packer version

1.8.3 and 1.0.4

Simplified Packer Buildfile

source "virtualbox-vm" "ubuntu" {
  ssh_host = "127.0.0.1"
  ssh_port = "2222"
}

Operating system and Environment details

n/a

Log Fragments and crash.log files

2022/09/08 15:19:29 packer-plugin-virtualbox_v1.0.4_x5.0_linux_amd64 plugin: 2022/09/08 15:19:29 [INFO] Attempting SSH connection to 127.0.0.1:3171...
2022/09/08 15:19:29 packer-plugin-virtualbox_v1.0.4_x5.0_linux_amd64 plugin: 2022/09/08 15:19:29 [DEBUG] reconnecting to TCP connection for SSH
2022/09/08 15:19:29 packer-plugin-virtualbox_v1.0.4_x5.0_linux_amd64 plugin: 2022/09/08 15:19:29 [DEBUG] handshaking with SSH
2022/09/08 15:19:29 packer-plugin-virtualbox_v1.0.4_x5.0_linux_amd64 plugin: 2022/09/08 15:19:29 [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:42718->127.0.0.1:3171: read: connection reset by peer

@mschuchard mschuchard added the bug label Sep 8, 2022
@mschuchard
Copy link
Author

Also noticing that setting ssh_password or ssh_certificate_file argument values results in authentication method [none] during ssh communicator attempts, so this could be multiple ssh communicator arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant