alexellis/k3sup

SSH Error Handshake

hseshadr opened this issue · 2 comments

I followed this tutorial to create two k3s instances in Digital Ocean using k3sup.
Just amazing how quick and trouble free this setup was. The only difference is
that I did not create a k3s-3 droplet. I checked that everything is running:

harish@harishs-mbp-2 ~ % export KUBECONFIG=pwd/kubeconfig
kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k3s-1 Ready control-plane,master 43m v1.25.4+k3s1 xxx.xxx.xxx.20 Ubuntu 22.10 5.19.0-23-generic containerd://1.6.8-k3s1
k3s-2 Ready 42m v1.25.4+k3s1 xxx.xxx.xxx.6 Ubuntu 22.10 5.19.0-23-generic containerd://1.6.8-k3s1
harish@harishs-mbp-2 ~ %

The next step is that I want to run a local multipass ubuntu node in my laptop and have the node join the k3s network. I created a cloud-init yaml and added the public key

#cloud-config
ssh_authorized_keys:

  • ssh-rsa AAABBBCCC....

multipass launch --cpus 1 --mem 1G --disk 15G --name k3s-3 --cloud-init ~/dev/faas/cloud-init.yaml

The VM was created successfully
harish@harishs-mbp-2 ~ % multipass info k3s-3
Name: k3s-3
State: Running
IPv4: 192.168.64.7
Release: Ubuntu 22.04.1 LTS
Image hash: b9a5a216901c (Ubuntu 22.04 LTS)
Load: 1.21 0.35 0.12
Disk usage: 1.7G out of 14.4G
Memory usage: 486.4M out of 969.6M
Mounts: --
harish@harishs-mbp-2 ~ %

Let's make sure that we can ssh into the VM:

harish@harishs-mbp-2 ~ % ssh ubuntu@192.168.64.7
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-56-generic x86_64)

System information as of Wed Dec 28 13:27:37 PST 2022

System load: 0.232421875
Usage of /: 16.7% of 14.36GB
Memory usage: 71%
Swap usage: 0%
Processes: 116
Users logged in: 0
IPv4 address for cni0: 10.42.0.1
IPv4 address for enp0s2: 192.168.64.7
IPv6 address for enp0s2: fd44:ae38:7954:ff84:b4c7:60ff:fe89:5e71

0 updates can be applied immediately.

ubuntu@k3s-3:~$

Next Step: Add the VM to the network with K3s

harish@harishs-mbp-2 ~ %
export AGENT_IP=192.168.64.7
export SERVER_IP=xxx.xxx.xxx.20
export USER=root
k3sup join --ip $AGENT_IP --server-ip $SERVER_IP --user $USER
Running: k3sup join
Server IP: xxx.xxx.xxx.20
Error: unable to connect to 192.168.64.7:22 over ssh: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
harish@harishs-mbp-2 ~ %

I don't understand why this is happening since I am able to SSH into the localVM and I am also able to SSH into the k3s-1 master in Digital Ocean. Any ideas?

I need to pass --user and --server-user

Glad you resolved this 😄

We do have examples in the docs, but let us know how you think it can be improved?