Capistrano authentication failure on a Vagrant VM

I was having issues getting Capistrano to SSH into a Vagrant VM. I could shell in myself but Capistrano always returned the following error:

connection failed for: (Net::SSH::AuthenticationFailed: Authentication failed for user vagrant@

Note: is my private network set up in the vagrantfile.


Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = 'precise32'
    config.vm.host_name = 'virtualmachine' "private_network", :ip => ''
    config.vm.provider :virtualbox do |v|
        v.customize ["modifyvm", :id, "--memory", 4096]

For me, the problem only occurred with the local VM. Capistrano had no problems interacting with remove web servers via SSH.

Try changing the version of the net-ssh gem in use per this SO post. For me, locking net-ssh to 2.8.1 solved the issue. There were some Stackoverflow comments suggesting the bug reappears in newer releases.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *