I created a three node multi-machine vagrant environment and am having issues ssh'ing from one vagrant vm to another.
Here is the Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.define "master" do |master|
master.vm.hostname = "master.local"
master.vm.network "private_network", type: "dhcp"
end
config.vm.define "node1" do |node1|
node1.vm.hostname = "node1.local"
node1.vm.network "private_network", type: "dhcp"
end
config.vm.define "node2" do |node2|
node2.vm.hostname = "node2.local"
node2.vm.network "private_network", type: "dhcp"
end
end
The hosts file (same on each node):
$ cat /etc/hosts
172.28.128.3 master.local master
172.28.128.4 node1.local node1
172.28.128.5 node2.local node2
I can ping back and forth all day from any machine to the other but I cannot ssh from one vagrant vm to the other. The typical error message is (from node1 to master):
[[email protected]] $ ssh [email protected]
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
SSH is running and the port is open.
The firewall is not running.
I am sure this has to do with ssh keys. I readily admit I am not an expert.
What am I doing wrong here folks?
ssh vagrant@host
and usevagrant
as a password as well.ip a
of all boxes to the question and check whether the IP addresses (172.28.128.3-5) are available when the boxes are down.