SSHAuthenticationFailed error
This commit is contained in:
parent
500a63c269
commit
bab369e856
|
@ -56,6 +56,11 @@ module Vagrant
|
||||||
error_key(:no_env)
|
error_key(:no_env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class SSHAuthenticationFailed < VagrantError
|
||||||
|
status_code(11)
|
||||||
|
error_key(:ssh_authentication_failed)
|
||||||
|
end
|
||||||
|
|
||||||
class SSHUnavailableWindows < VagrantError
|
class SSHUnavailableWindows < VagrantError
|
||||||
status_code(10)
|
status_code(10)
|
||||||
error_key(:ssh_unavailable_windows)
|
error_key(:ssh_unavailable_windows)
|
||||||
|
|
|
@ -105,7 +105,7 @@ module Vagrant
|
||||||
check_thread.join(env.config.ssh.timeout)
|
check_thread.join(env.config.ssh.timeout)
|
||||||
return check_thread[:result]
|
return check_thread[:result]
|
||||||
rescue Net::SSH::AuthenticationFailed
|
rescue Net::SSH::AuthenticationFailed
|
||||||
error_and_exit(:vm_ssh_auth_failed)
|
raise Errors::SSHAuthenticationFailed.new
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks the file permissions for the private key, resetting them
|
# Checks the file permissions for the private key, resetting them
|
||||||
|
|
|
@ -11,6 +11,11 @@ en:
|
||||||
multi_vm_required: A multi-vm environment is required for name specification to this command.
|
multi_vm_required: A multi-vm environment is required for name specification to this command.
|
||||||
multi_vm_target_required: `vagrant %{command}` requires a specific VM name to target in a multi-VM environment.
|
multi_vm_target_required: `vagrant %{command}` requires a specific VM name to target in a multi-VM environment.
|
||||||
no_env: No Vagrant environment detected. Run `vagrant init` to set one up.
|
no_env: No Vagrant environment detected. Run `vagrant init` to set one up.
|
||||||
|
ssh_authentication_failed: |-
|
||||||
|
SSH authentication failed! This is typically caused by the public/private
|
||||||
|
keypair for the SSH user not being properly set on the guest VM. Please
|
||||||
|
verify that the guest VM is setup with the proper public key, and that
|
||||||
|
the private key path for Vagrant is setup propery as well.
|
||||||
ssh_unavailable_windows: |-
|
ssh_unavailable_windows: |-
|
||||||
`vagrant ssh` isn't available on the Windows platform. The
|
`vagrant ssh` isn't available on the Windows platform. The
|
||||||
vagrant.ppk file for use with Putty is available at:
|
vagrant.ppk file for use with Putty is available at:
|
||||||
|
|
|
@ -200,21 +200,6 @@
|
||||||
The vagrant virtual environment you are trying to package must be powered off.
|
The vagrant virtual environment you are trying to package must be powered off.
|
||||||
:vm_mount_fail: |-
|
:vm_mount_fail: |-
|
||||||
Failed to mount shared folders. vboxsf was not available.
|
Failed to mount shared folders. vboxsf was not available.
|
||||||
:vm_ssh_auth_failed: |-
|
|
||||||
SSH authentication failed! While this could be due to a variety of reasons,
|
|
||||||
the two most common are: private key path is incorrect or you're using a box
|
|
||||||
which was built for Vagrant 0.1.x.
|
|
||||||
|
|
||||||
Vagrant 0.2.x dropped support for password-based authentication. If you're
|
|
||||||
tring to `vagrant up` a box which does not support Vagrant's private/public
|
|
||||||
keypair, then this error will be raised. To resolve this, read the guide
|
|
||||||
on converting base boxes from password-based to keypairs here:
|
|
||||||
|
|
||||||
http://vagrantup.com/docs/converting_password_to_key_ssh.html
|
|
||||||
|
|
||||||
If the box was built for 0.2.x and contains a custom public key, perhaps
|
|
||||||
the path to the private key is incorrect. Check your `config.ssh.private_key_path`.
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# CATEGORY: Error Messages for Linux System
|
# CATEGORY: Error Messages for Linux System
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
|
|
|
@ -229,8 +229,7 @@ class SshTest < Test::Unit::TestCase
|
||||||
|
|
||||||
should "error and exit if a Net::SSH::AuthenticationFailed is raised" do
|
should "error and exit if a Net::SSH::AuthenticationFailed is raised" do
|
||||||
@ssh.expects(:execute).raises(Net::SSH::AuthenticationFailed)
|
@ssh.expects(:execute).raises(Net::SSH::AuthenticationFailed)
|
||||||
@ssh.expects(:error_and_exit).with(:vm_ssh_auth_failed).once
|
assert_raises(Vagrant::Errors::SSHAuthenticationFailed) { @ssh.up? }
|
||||||
@ssh.up?
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue