Can't SSH into Vagrant VM (without using vagrant ssh)


Sloan Ahrens

In preparation for adapting the fabric deployment script for use by a local Vagrant VM, I'm trying to convince the VM to let me SSH into it without using SSH vagrant ssh. I keep getting errors.

I've tried many different combinations of settings, but here are the latest Vagrant files:​​​

Vagrant.configure(2) do |config|

  config.vm.provider "virtualbox" do |v|
    v.memory = 6144
    v.cpus = 2
    v.name = "mb_vagrant"
  end

  config.vm.box = "ubuntu/trusty64"

  config.vm.network :private_network, ip: "192.168.33.10"

  config.ssh.forward_agent = true

  config.vm.provision :shell, path: "bootstrap.sh"
  config.vm.network :forwarded_port, host: 8001, guest: 8001

end

vagrant ssh-configshow me:

Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/sloan/code/vagrant/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

If I try to SSH with the set key file and IP, the connection is refused:

> ssh -i /Users/sloan/code/vagrant/.vagrant/machines/default/virtualbox/private_key -p 2222 [email protected]
ssh: connect to host 192.168.33.10 port 2222: Connection refused

If I try the same method [email protected]instead of the [email protected]host key verification fails.

What am I missing here?

Matt Clark

Host key verification failed

This is a security feature of ssh that tries to stop a man-in-the-middle attack before it happens.

The last time your computer put it into that idle box, it stored a copy of the server's signature. When you connect now, most likely after a rebuild, you connect to the same physical address and the signatures don't match now.

To clear stale entries, you can find them in a plain text file on the ~/.ssh/known_hostsclient device (the one you are trying to ssh from ) .

Related


Can't SSH into Vagrant VM (without using vagrant ssh)

Sloan Ahrens In preparation for adapting the fabric deployment script for use by a local Vagrant VM, I'm trying to convince the VM to let me SSH into it without using SSH vagrant ssh. I keep getting errors. I've tried many different combinations of settings, b

Can't SSH into Vagrant VM (without using vagrant ssh)

Sloan Ahrens In preparation for adapting the fabric deployment script for use by a local Vagrant VM, I'm trying to convince the VM to let me SSH into it without using SSH vagrant ssh. I keep getting errors. I've tried many different combinations of settings, b

Can't SSH into Vagrant VM (without using vagrant ssh)

Sloan Ahrens In preparation for adapting the fabric deployment script for use by a local Vagrant VM, I'm trying to convince the VM to let me SSH into it without using SSH vagrant ssh. I keep getting errors. I've tried many different combinations of settings, b

Can't access Vagrant using ssh

misterFlex I'm using Vagrant for work and need to share my box with colleagues who travel. So, I packed the box with Vagrant command vagrant packageand got a .box file. So, on another PC, I added the box to, vagrant box add my-box.box serv-devand it worked vag

Can't access Vagrant using ssh

misterFlex I'm using Vagrant for work and need to share my box with colleagues who travel. So, I packed the box with Vagrant command vagrant packageand got a .box file. So, on another PC, I added the box to, vagrant box add my-box.box serv-devand it worked vag

Vagrant SSH tunnel after using `vagrant ssh`

Little Hadron Collider My MySQL client (Sequel Pro) is set up to connect to Vagrant via SSH. I have the following set in the ~/.ssh/configfile : Host vagrant HostName 127.0.0.1 CheckHostIP no Port 2222 User vagrant IdentityFile ~/.vagrant.d/insecure_

Can't SSH into new Vagrant install of 13.04

Moshe Katz I used the Vagrant image of 13.04 from http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box to create a new virtual machine and tried to connect to It uses ssh. However, SSH always disconnects immediate

Can't SSH into new Vagrant install of 13.04

Moshe Katz I used the Vagrant image of 13.04 from http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box to create a new virtual machine and tried to connect to It uses ssh. However, SSH always disconnects immediate

Can't understand vagrant SSH implementation

Timur Fitzrakhmanov I've recently started using Vagrant (also recently migrated from Windows to Ubuntu). My goal is to understand the basics of vagrant ssh... So I'm trying to understand what vagrant ssh's actually going on. I've read , vagrant sshwhat does it

Can't SSH into new Vagrant install of 13.04

Moshe Katz I used the Vagrant image of 13.04 from http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box to create a new virtual machine and tried to connect to It uses ssh. However, SSH always disconnects immediate

vagrant multi-vm ssh not working

Athinggoingon I set up a multi-VM environment by using the Vagrantfile at the bottom. But I can't fall into any box. I've tried vagrant ssh vm-cluster-node1, but it says: "No machine named 'vm-cluster-node1' configured for this Vagrant environment was found."

vagrant ssh cannot connect to vm on windows 10

Aya Muhammad [EDIT] I uninstalled vagrant and virtualbox. I have virtualbox version 5.0 and the latest version of vagrant, and now I have the latest version of both (virtual box 6.0.1), I tried the same general steps but the same unwanted output appears. vagra

vagrant ssh cannot connect to vm on windows 10

Aya Muhammad [EDIT] I uninstalled vagrant and virtualbox. I have virtualbox version 5.0 and the latest version of vagrant, and now I have the latest version of both (virtual box 6.0.1), I tried the same general steps but the same unwanted output appears. vagra

ssh-agent forwarding for vagrant VM

legend Currently, I'm looking at setting up a vagrant environment on my mac machine so I can run vagrant upand then install rbenvand rubyeverything I need. Then I have a Bash script that will fetch all my repositories from github. The only problem is that the

vagrant multi-vm ssh not working

Athinggoingon I set up a multi-VM environment by using the Vagrantfile at the bottom. But I can't fall into any box. I've tried vagrant ssh vm-cluster-node1, but it says: "No machine named 'vm-cluster-node1' configured for this Vagrant environment was found."

ssh vagrant not working inside virtual box VM

Ashish Karpe I have Ubuntu VM in Virtual Box: # lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty ssh vagrant doesn't work properly on Ubuntu VM: root@ubuntu-stu

ssh-agent forwarding for vagrant VM

legend Currently, I'm looking at setting up a vagrant environment on my mac machine so I can run vagrant upand then install rbenvand rubyeverything I need. Then I have a Bash script that will fetch all my repositories from github. The only problem is that the

ssh vagrant not working inside virtual box VM

Ashish Karpe I have Ubuntu VM in Virtual Box: # lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty ssh vagrant doesn't work properly on Ubuntu VM: root@ubuntu-stu

Can't SSH to VM

Ken I have a VM installed and some custom disk images (CentOS) at work, but I can't SSH into the VM. Here are some things I've tried: [VM]$ ssh root@localhost Password: Great, ssh is using loopback. But when I try from host: ~/VirtualBox VMs% ssh -v -v -v roo

Can't SSH to VM

Ken I have a VM installed and some custom disk images (CentOS) at work, but I can't SSH into the VM. Here are some things I've tried: [VM]$ ssh root@localhost Password: Great, ssh is using loopback. But when I try from host: ~/VirtualBox VMs% ssh -v -v -v roo

vagrant ssh - command doesn't work

john_911 I'm trying to pass a simple command to a vagrant machine. vagrant ssh -c "mysql -u root -e'CREATE DATABASE testing';" Database not created. Instead, I just "login" to the vagrant machine via ssh. The same thing happens when I run vagrant ssh -c "touc