-
Notifications
You must be signed in to change notification settings - Fork 572
Common Pitfalls
(Don't see your pitfall here? Add it after you figure out what's wrong)
Try running Vagrant with the VAGRANT_LOG
environment variable set to debug
. This will dump extra details about the SSH connection to standard output. See examples below to diagnose common SSH issues.
Example error message:
E, [2014-07-19T14:10:41.111055 #97613] ERROR -- net.ssh.authentication.key_manager[84047d54]:
could not load private key file `/home/joeuser/.ssh/private_key.pem': ArgumentError (Could not parse
PKey: no start line)
This can happen if the private key is protected with a passphrase. A passphrase-protected key will start with a header similar to this:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,4E9935C69A91D40B616F914A39893610
The Proc-Type
and DEK-Info
lines indicate passphrase protection. You will have to remove the passphrase from the private key to make it parseable. If you use OpenSSH, you can use ssh-keygen -p
to do this (see the ssh-keygen(1) man page).
From a Windows user: For me, I was trying to use a .ppk file (which apparently is a putty-specific format) and this error was saying SSH didn't know what to do with it. If you have a .ppk file you can extract the private key using puttygen. First load the ppk as the private key, then Menu -> Conversion -> Export OpenSSH key. Customary extension for this file is .pem. I believe Vagrant-aws currently fails if the .pem file has a passphrase, so omit that.
This can happen if you are starting a VPC instance but you are not connected to the VPC's network through a VPN tunnel.
If you are connected through the VPN, try connecting to the instance with SSH directly. If you can connect this way but Vagrant's connections are still being refused, check your VPN settings on the local end for a setting like "route all outbound traffic through the VPN." If this setting is turned off, turn it on and try again.
Under Windows, RSync will try and update the %HOME%/.ssh/known_hosts file. If %HOME% is not defined as one of your environment variables, it may try and add/update that file where it has no permissions, and fail. Solution: Set user environment variable HOME to be %USERPROFILE%.
See Amazon Linux AMI.