-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
SSH communicator with bastion and ssh-agent broken post 1.8.0 #12099
Comments
In addition to the ssh_bastion_* variables being ignored now, it seems other settings are also being ignored. Not sure how related this may be, but it seems the ssh_timeout is also being by-passed. No matter what I set it to, it seems to wait 5 minutes. |
just curious if some one was able to resolve this issue.We have similar issue everything works with old packer version 1.6.x with 1.8.5 or 1.9.1 its failing. |
We are also running into same issues any help over here i mean guidance? |
Seems to still exist in latest version, 1.10.1. I think this may be related to this plugin SDK issue. Also likely related to [another issue I opened] on this repository(#12100). |
@JavaGuy147 just FYI once we moved away from the RSA to ED25519 issue hand shake issue resolved but we had a task in ansible where server gets rebooted we saw issue with packer not being able to reconnect once we added variable usetty = false in ansible.cfg or "ANSIBLE_SSH_USETTY": "False" things got moving.Issue is mainly related to RSA keys with SHA1 Algorithm in our case |
Community Note
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
Packer is able to access an AWS EC2 instance via a bastion and using key from ssh-agent in version 1.8.0 but not 1.8.1+.
Output below is when using
PACKER_LOG=1
.When using 1.8.0, debug output shows connection refused before eventually succeeding:
Whereas 1.8.1+ shows the following repeatedly until SSH timeout is reached and the build fails.
1.8.1:
1.8.4 (latest):
Note: IP and hostnames in the above are examples.
I find it interesting that the working example doesn't mention the bastion, whereas the failing one does, but I working example has to be using the bastion as that is the only IP allowed on port 22 in the one security group we attach.
If I use
on-error=ask
to keep the instance booted when it fails to connect, I can successfully SSH from another terminal using the same key in ssh-agent like so:ssh -J [email protected] [email protected]
. The key being used in this case is RSA (id_rsa) and a certificate signed public key (id_rsa-cert.pub), both loaded into ssh-agent viassh-add
.Reproduction Steps
1.) Start ssh-agent, add key.
2.) Run packer with specific version on a template similar to the one posted below.
Packer version
Working: 1.8.0
Broken: 1.8.1+
Simplified Packer Template
Operating system and Environment details
OS: Ubuntu 20.04 (in Windows Subsystem for Linux 2, running under Windows 10)
Architecture: x86_64
Log Fragments and crash.log files
Fragments included above where needed.
The text was updated successfully, but these errors were encountered: