While trying to setup the cluster using <https://github.com/mmumshad/kubernetes- . . .

Dhawan Shringi:
While trying to setup the cluster using https://github.com/mmumshad/kubernetes-the-hard-way, I am unable to ssh from master-1 to rest of the nodes. The error that I am getting trying to ssh to the other nodes from master-1 is [email protected]: Permission denied (publickey). I’ve already checked the public key is added to the authorized_keys file in other nodes, not sure what am I missing. Appreciate any help with this, thanks!

unnivkn:
https://serverfault.com/questions/966223/how-to-configure-ssh-for-vagrant-environment

unnivkn:
Did you tried this ?

unnivkn:
View the generated public key ID at:

$cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD......8+08b vagrant@master-1

Move public key of master to all other VMs

$cat &gt;&gt; ~/.ssh/authorized_keys &lt;&lt;EOF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD......8+08b vagrant@master-1
EOF

Logging in other nodes from master-1 (master node)

$ vagrant@master-1:~$
.
.
.
$ vagrant@worker-2:~$

Dhawan Shringi:
Yes, this is exactly what I have followed. From what I understand it’s about couple of things:

  1. the public key needs to be added to the authorized_keys in the remote host
  2. the permission for authorized_keys needs to be 644
    I’ve checked the above two conditions are fulfilled. I am able to do vagrant ssh master-2 from my local machine so somehow that’s working fine but when I do the same from master-1 it fails to find the public key in the authorized_keys of master-2. The first line of the authorized_keys is the one generated by the setup scripts shared in the github and I have added the master-1 public key right after that in the authorized_keys, just don’t understand why when the master-2 receives the ssh request, it doesn’t find a match for the master-1 public key.

Dhawan Shringi:
The serverfault issue is spot-on though, I’m facing the same issue with similar error log as below:

ssh [email protected]
[email protected]: Permission denied (publickey).

However, I don’t have any issue with ssh from local machine which is mentioned in the post as below:

vagrant@ubuntu-bionic:~$ vagrant ssh vagrant@n1
The machine with the name 'vagrant@n1' was not found configured for
this Vagrant environment.

Dhawan Shringi:
@unnivkn Thanks for your help, it was a silly mistake at my end, the public key added to authorized_hosts was incorrect.