I want to connect to my kubernetes nodes (GKE) using SSH CA certificates, but in order to do so, I need to put the SSH CA public key on my fleet and add the path to the file in my sshd_config in every of my instances that gets created for kubernetes.

How should I do this? With the startup script? Or is it anything better?

Also, if I put this line on the sshd_config and I don't add any other public SSH Key, I won't have any user by default to log in.

Thank you


There are a couple of approaches to do this so it depends on what you need from the setup.

GKE nodes are regular GCE instances so you can just add ssh keys normally. See for details this link.

For a more secure approach, you can use OS Login and gcloud command as described here.

I would like to note, anyway, that generally you shouldn't need to get direct access to GKE nodes.

Of course, you have the freedom to do that since they are instances under your management. But please note that Google's understanding will be that you know what you are doing and will not impact the normal functioning of the GKE deployments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.