This message was deleted.
# harvester
a
This message was deleted.
f
can i mount on my harvester node a file in the mount point
/home/rancher/.ssh/authorized_keys
?
or how to accomplish with elemental-toolkit?
b
You can simply copy the keys to the nodes. They are not overwritten by the one in /oem/90_custom.yaml. But any key there is added again after a reboot, so you might replace it there too.
f
if you simply copy the keys over, won't the node start a rollback because its not in the desired state?
b
Harvester (or MicroOS) does not behave like this. It's only reconceiling the state while booting. And unfortunately it is not consistent (and documented) which values from /oem/90_custom.yaml are reconceiled. Some are, and overwrite existing files or configs, others don't. The ssh key from 90_custom.yaml is simply added to the authorized_keys file of the rancher user. Other old keys stay there. You need to remove them manually, and also replace them in 90_custom.yaml, otherweise they are added after next boot again. Something similar to
yq -i '.stages.network.[0].authorized_keys.rancher.[0] = \"$(cat "ssh-key.pub")\"' /oem/90_custom.yaml
👍 1