Everything works until the last step… No matter what I do I always get “server refused our key”.
Searching seems to show I am not the first with this issue. I’ve read a couple different guides and seen a couple different examples of cloud-config.yml files and they do not appear to be consistent . (Different RancherOS versions maybe?)
I have tried (as separate cloud-config.yml file entries)
ssh_authorized_keys:
- ssh-rsa AAAAB… rest of my key … ==
- ssh-rsa AAAAB… rest of my key … == rancher@rancher
- ssh-rsa AAAAB… rest of my key … == RancherOS
Any help would be greatly appreciated. I am testing it out in a VM, before I attempt to install it in my home lab bare metal server.
Note: I am using Atom + js-yaml linter to verify my cloud-config.yml file locally before I copy/paste it into vi.
Example: #cloud-config
hostname: rancher
ssh_authorized_keys:
- ssh-rsa AAA ... the rsa key ... ==
rancher:
docker:
tls: true
network:
dns:
nameservers:
# google DNS
- 8.8.8.8
- 8.8.4.4
interfaces:
eth*:
dhcp: true # all interfaces use DHCP
The text after the base64-encoded key is a comment to help you identify the key and is not used in any way. Typically it’s “user@host” where the key was generated.
You need #cloud-config at the beginning of the file. You mention it but you have no one complete valid example with a key in your post.
The entire key also needs to be one line in the file, you may be pasting multiple line breaks.
And you don’t show how you’re trying to connect, but the username needs to be “rancher”, i.e. ssh rancher@1.2.3.4 or ssh -l rancher 1.2.3.4.
Good to know about the data after the key not being critical. So that should not be the problem.
My cloud-config.yml was almost identical to the lines after “Example:”. It did start with #cloud-config, but I am not certain if it was the very first line or not. Would white space there cause a problem? (It is the top line in my desktop cloud-config.yml, but after pasting into VI maybe there was white space at the top.)
Been trying to connect via Putty, following the guide listed.
-> Session - IP address is correctly set
-> Data - “Auto-login user name” is rancher > Data
-> SSH -> Auth -> Private Key file - set to my rancher.ppk
It seems like I am really close, but something small is preventing it from working.
Update:
Thank you. This time while doing it, I was very careful to make sure the #cloud-config was entered properly. For whatever reason, while copy/paste into vi, it was not taking the first couple of characters so the file started like oud-config and not #cloud-config.
Now I was able to SSH into the box. =) I figured it had to be something really simple but completely missed.