Vagrant: Cannot ignore new Windows 10 built-in SSH client in Vagrant 2.0.2

Created on 2 Feb 2018  ยท  7Comments  ยท  Source: hashicorp/vagrant

Vagrant version

Vagrant 2.0.2

Host operating system

Windows 10 x64 version 1709 (OS Build 16299.214)
also: VirtualBox 5.2.6 r120293

C:\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_7.5p1, without OpenSSL

Guest operating system

Ubuntu 14.04

Vagrantfile

The result of vagrant init ubuntu/trusty is sufficient.

Expected behavior

vagrant ssh should succeed.

Actual behavior

vagrant ssh returned error:

[email protected]: Permission denied (publickey).

Steps to reproduce

  1. Install Windows 10 OpenSSH beta
  2. Open default shell (PowerShell) via Win+X, i. Also reproducible with cmd.exe shell.
  3. vagrant init ubuntu/trusty
  4. vagrant up
  5. vagrant ssh

References

With increased verbosity (eg vagrant ssh -- -vvv) the output shows:

Load key "./.vagrant/machines/section/virtualbox/private_key": invalid format.

This Load key ... invalid format error is most likely a bug with Windows 10's OpenSSH Beta, possibly related to only ed25519 keys currently being supported: https://github.com/PowerShell/Win32-OpenSSH/issues/973#issuecomment-349065648

However, I cannot easily coerce Vagrant to use its embedded SSH client instead since this change:
https://github.com/hashicorp/vagrant/issues/9143#issuecomment-361635432

I'd hoped VAGRANT_PREFER_SYSTEM_BIN=0 vagrant ssh or VAGRANT_PREFER_SYSTEM_BIN=false vagrant ssh would work but it didn't.

Modifying the PATH to exclude C:\Windows\System32\OpenSSH resolves the issue. Using a Cygwin shell with its own SSH client also resolves the issue.

Uninstalling the Windows 10 SSH beta also resolves the issue.

Would be great if Vagrant 2.0.2 can be forced to use embedded SSH via vargant-specific environment variable command line parameter or even if Vagrant could generate ed25519 SSH keys.

communicatossh hoswindows

Most helpful comment

I uninstall Powershell SSH ( System32/openSSH), then restarted the system. Now I can access vagrant via ssh. Run vagrant ssh --debug, then you can find the real issue.

Goto App-> Manage Optional features -> Uninstall OpenSSH components ( Windows 10 settings)

All 7 comments

on a bare new W10 system I got this:

Permissions for 'D:/Repo/vagrant/.vagrant/machines/default/virtualbox/private_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "D:/Repo/vagrant/.vagrant/machines/default/virtualbox/private_key": bad permissions
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).

had to explicitly give permissions to the private key removing 'Authenticated users' and 'users' from acl.

I uninstall Powershell SSH ( System32/openSSH), then restarted the system. Now I can access vagrant via ssh. Run vagrant ssh --debug, then you can find the real issue.

Goto App-> Manage Optional features -> Uninstall OpenSSH components ( Windows 10 settings)

Have to try that, thank you.

@sibinx7 that is not a real solution. there should no be conflict with powershell

I have a similar issues and it seems related to private_key file permission:
OS: Win10, vagrant 2.0.2
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for '[..]\default\virtualbox\private_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "[..]\default\virtualbox\private_key": bad permissions
[email protected]: Permission denied (publickey).

@Raffaello Yes, It just a workaround. I had this issue after I install Heroku command line tool and PowerShell openssh. Anyway vagrant is working fine with Cmder.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luispabon picture luispabon  ยท  3Comments

dorinlazar picture dorinlazar  ยท  3Comments

rhencke picture rhencke  ยท  3Comments

tomhking picture tomhking  ยท  3Comments

lebogan picture lebogan  ยท  3Comments