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

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

Closed
jstangroome opened this issue Feb 2, 2018 · 7 comments · Fixed by #9503
Closed

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

jstangroome opened this issue Feb 2, 2018 · 7 comments · Fixed by #9503

Comments

@jstangroome
Copy link

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:

vagrant@127.0.0.1: 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: PowerShell/Win32-OpenSSH#973 (comment)

However, I cannot easily coerce Vagrant to use its embedded SSH client instead since this change:
#9143 (comment)

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.

@besmirzanaj
Copy link

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.
vagrant@127.0.0.1: Permission denied (publickey).

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

@sibinx7
Copy link

sibinx7 commented Mar 7, 2018

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)

@besmirzanaj
Copy link

besmirzanaj commented Mar 7, 2018

Have to try that, thank you.

@Raffaello
Copy link

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

@Raffaello
Copy link

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
vagrant@127.0.0.1: Permission denied (publickey).

@sibinx7
Copy link

sibinx7 commented Mar 15, 2018

@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.

@ghost
Copy link

ghost commented Mar 30, 2020

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.

@hashicorp hashicorp locked and limited conversation to collaborators Mar 30, 2020
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.

6 participants