Create an SSH key pair
To enable encrypted communications with your cluster, you must create anasymmetric key pair (a public and a private key) and associate it with yourcontrol plane or node pool virtual machines.
To generate an asymmetric key pair, run the following command:
ssh-keygen-trsa-mPEM-b4096-C"COMMENT"\-fSSH_PRIVATE_KEY-N""1>/dev/nullReplace the following:
SSH_PRIVATE_KEY: a file name to save the key inCOMMENT: a text string describing the key
This creates two files:SSH_PRIVATE_KEY containing yourSSH private key, andSSH_PRIVATE_KEY.pub containing thecorresponding public key.
To save your SSH public key into an environment variable, run the followingcommand:
SSH_PUBLIC_KEY=$(catSSH_PRIVATE_KEY.pub)What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-24 UTC.