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

WinSSH Communicator errors out with Vagrant 2.2.16 #12381

Closed
tik opened this issue May 22, 2021 · 1 comment · Fixed by #12415
Closed

WinSSH Communicator errors out with Vagrant 2.2.16 #12381

tik opened this issue May 22, 2021 · 1 comment · Fixed by #12415

Comments

@tik
Copy link

tik commented May 22, 2021

Vagrant version

2.2.16

Host operating system

Windows 10 x64

Guest operating system

Windows 10 x64

Debug output

    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Attempting graceful shutdown of VM...
...
==> default: Attempting graceful shutdown of VM...
C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/vagrant-2.2.16/lib/vagrant/patches/net-ssh.rb:10:in `rsa_compat_build_request': undefined method `[]' for nil:NilClass (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:41:in `send_request'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:51:in `authenticate_with'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/net-ssh-6.1.0/lib/net/ssh/authentication/methods/publickey.rb:20:in `block in authenticate'

Expected behavior

Vagrant should continue bringing up the machine.

Actual behavior

Vagrant errors out with above stacktrace.

This is because the regex in vagrant/lib/vagrant/patches/net-ssh.rb for matching the OpenSSH version is not compatible with the version string of the build in OpenSSH server in Windows. 'OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2'

Changing the regex to something like /OpenSSH_.*(?<version>\d+\.\d+).*/ makes vagrant work as expected.

chrisroberts added a commit to chrisroberts/vagrant that referenced this issue Jun 11, 2021
    Set flag on RSA keys of deprecated RSA SHA1 support when loading
    keys based on server version of the transport. This ensures keys
    are properly flagged. Flag name has been updated to provide context
    on usage.

    Version matching on the OpenSSH server version has also been updated
    to handle customized naming in the version string (as seen in the
    Windows port) and to properly handle when no match is found.

    Fixes hashicorp#12344 hashicorp#12408 hashicorp#12381
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants