2016-07-29 8 views
5

필자는 어쩔 수없는 자극적 인 문제를 겪고 있습니다.Vagrant ssh '인증에 실패했습니다. 재시도 중 ... '반복되는 오류 - 키가 일치하지 않고 수정 할 수 없음

내가 vagrant up이 환경에서 centos7 시스템을 시도하고있다 :

  • 윈도우 10
  • 의 Hyper-V (안 주년 기념 업데이트 버전)
  • 도커 이미지 "serveit/centos7"또는 "
  • OpenSSH를 설치, 개인 키의

내용을 구성 bluefedora/하이퍼 - 알파 - centos7 "내 Vagrantfile하십시오 vagrant up을 수행 할 때

Vagrant.configure("2") do |config| 
    #config.vm.box = "serveit/centos-7" 
    config.vm.box = "bluefedora/hyperv-alpha-centos7" 
    config.ssh.private_key_path = "~/.vagrant.d/insecure_private_key" 
    config.ssh.forward_agent = true 
end 

나는이 오류가 무엇입니까 :

PS C:\Programs\vagrant_stuff\centos7> vagrant up 
Bringing machine 'default' up with 'hyperv' provider... 
==> default: Verifying Hyper-V is enabled... 
==> default: Importing a Hyper-V instance 
    default: Cloning virtual hard drive... 
    default: Creating and registering the VM... 
    default: Successfully imported a VM with name: vagrantbox 
==> default: Starting the machine... 
==> default: Waiting for the machine to report its IP address... 
    default: Timeout: 120 seconds 
    default: IP: 192.168.137.6 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 192.168.137.6:22 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace 
    default: this with a newly generated keypair for better security. 
    default: 
    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: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
    default: Warning: Authentication failure. Retrying... 
Timed out while waiting for the machine to boot. This means that 
Vagrant was unable to communicate with the guest machine within 
the configured ("config.vm.boot_timeout" value) time period. 

If you look above, you should be able to see the error(s) that 
Vagrant had when attempting to connect to the machine. These errors 
are usually good hints as to what may be wrong. 

If you're using a custom box, make sure that networking is properly 
working and you're able to connect to the machine. It is a common 
problem that networking isn't setup properly in these boxes. 
Verify that authentication configurations are also setup properly, 
as well. 

If the box appears to be booting properly, you may want to increase 
the timeout ("config.vm.boot_timeout") value. 

내가 할 수있는 vagrant ssh-config : 나는에 vagrant haltvagrant up을 시도해야 다른 곳에서 본

Host default 
    HostName 192.168.137.6 
    User vagrant 
    Port 22 
    UserKnownHostsFile /dev/null 
    StrictHostKeyChecking no 
    PasswordAuthentication no 
    IdentityFile C:/Users/Kareem/.vagrant.d/insecure_private_key 
    IdentitiesOnly yes 
    LogLevel FATAL 
    ForwardAgent yes 

문제를 해결하십시오. 이것은 작동하지 않았다.

또한 .vagrant.d/insecure_private_key 파일을 삭제했으며 다시 만들어졌습니다. 아무런 문제도 없습니다. 암호 또한

vagrant ssh 작품 : 그래서

PS C:\Programs\vagrant_stuff\centos7> vagrant ssh 
[email protected]'s password: 
[[email protected] ~]$ 

내가 SSH 수 있기 때문에, 나는 .ssh/authorized_keys 파일 확인하기로 결정

[방랑 @ 로컬 호스트를 ~] $ 고양이 스푸핑/authorized_keys에

[[email protected] ~]$ cat /home/vagrant/.ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIRcYs0HBn/BOjiKg9fGnoraVxRnnZk+6sM3waFFE1+U3aO8GQjRKxQsYgJNoyRmNVymzpP13kOoLodDsz 
UKhdcO6dL+zAtmhsFTgmADMXxVzM3mfRWfPG2HdsU13Pof77A68Ln6z6X4jVG4cnsclYvz67Gudl7lZ9VI2TOdDn1V+7ZANlkGnqejIwA2RVWtYLgLQHU9p4 
47nvRqId71XaG8BZpbONRzzrL49wWyjfc4h6SdaHVJZJB6kY+vkr31xw6TPIIlo2UHH7Ihlk6KADNo4wFJYF+ozIA7C792omzjN1zu1SayvCYNG21yZy/cCd 
n2Hr158Jy83A9CslQPbT vagrant 

Dafuq가이 키입니까?!?! 저는 이것이 방랑자에 해당하는 공개 키가 아니라고 확신합니다. 이것은 또한 내 시스템 공용 키가 아닙니다. 나는 Vagrant Public key을 검사 할 때 나는이 얻을 :

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9H 
ZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHi 
lFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRd 
K8jlqm8tehUc9c9WhQ== vagrant insecure public key 

을 또한, 나는 내 시스템을 개인 키를 사용하여 내 Vagrantfile를 업데이트 할 경우 :

#config.ssh.private_key_path = "~/.vagrant.d/insecure_private_key" 
    config.ssh.private_key_path = "~/.ssh/id_rsa" 

을 나는 인 VM에 다른 공개 키를 얻을 Vagrant Public key는 :

[[email protected] ~]$ cat /home/vagrant/.ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9H 
ZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHi 
lFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRd 
K8jlqm8tehUc9c9WhQ== vagrant insecure public key 

또한 프로비저닝 프로세스가 새 키를 삽입하지 않는 것을 알 수있다. 이 모든 것은 거꾸로 보입니다. 개인 키를 사용하면 키가 업데이트되어야하며 내 키를 사용해야한다고 생각했습니다.

HELP!

왜 이런 일이 발생하는지 알 수 있습니까?

세부 here

당신이 1.8.5을 사용하는 경우, 업데이트 된 다운로드 할 수 있습니다

답변

7

은 (1.8.6에서 수정 될 예정입니다) 방랑 1.8.5에서 알려진 버그가 밝혀 PowerShell을 사용 PR #7611에서 버전 다음 방랑 기계에

[IO.File]::WriteAllLines("C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\guests\linux\cap\public_key.rb", (Invoke-WebRequest -Uri https://raw.githubusercontent.com/Poohblah/vagrant/41063204ca540c44f9555bd11ba9e76c7307bec5/plugins/guests/linux/cap/public_key.rb).Content)

+2

, 내가 배운 Mac에서 패치 할 파일은'/ opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/linux/cap/public_key.rb'입니다. (diff 내용은 링크에서 제공됩니다.) 모든 패치가 잘 작동합니다. – Wildcard

1

SSH 및이 권한을 제공합니다.

vagrant @ localhost : chmod 600 ~/.ssh/authorized_keys.

출구 밖으로 호스트에 복귀하고 "방랑 다시로드"그것은 작동

충돌!

2

파일 public_key.rb 내부하는 라인 (56)에서 사람들을 찾아과 같이 chmod 0600 ~/.ssh/authorized_keys를 추가 : Windows 용

  if test -f ~/.ssh/authorized_keys; then 

      grep -v -x -f '#{remote_path}' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmp 

      mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys 
      chmod 0600 ~/.ssh/authorized_keys 
     fi 

     rm -f '#{remote_path}' 

경로 : Mac 용 C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\guests\linux\cap\public_key.rb

경로 : 거기에 코멘트에서 /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/linux/cap/public_key.rb