rancher-hcloud
rancher-hcloud copied to clipboard
Disable password based authentication for SSH
Any specific reason why
https://github.com/alexzimmer96/rancher-hcloud/blob/master/module-cluster-init/scripts/rancher_management_init.sh#L6
# Disable password based authentication for SSH
# sed -i 's/[#]*PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
# sed -i 's/[#]*PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
# systemctl restart sshd
this is in comment? Think its better to really disable the password authentication?
I cant remember why its commented out. I'll have a look at this later.
I tried to create a cluster by enabling this, but then the process fails.
I think this is because the part
# This is necessary to wait for all installation tasks to finish
provisioner "remote-exec" {
inline = ["cloud-init status --wait > /dev/null"]
connection {
type = "ssh"
user = "root"
private_key = file(var.hcloud_ssh_key_path)
host = self.ipv4_address
}
}
in the resources_hetzner.tf file -> using root to logon here?
When I placed it in remark again, the creating succeeded again.
Actually this part is needed for Terraform to wait until cloud-init has finished. Otherwise, installing Rancher might fail because there's no docker installed.
I think i will need to have a closer look at that.
Ok; it's true that the process is not working when enabled...