Skip to content

Working with auto generated ssh keys Terraform deploy

Adao Junior edited this page Jul 13, 2020 · 1 revision

If you selected the option to auto generate the ssh keys on your ORM stack or Terraform scripts, the terraform will auto generate public and private keys.

The public key will be attached to the compute or worker nodes and the private key will appear on the output after you apply.

Follow the steps to use the key:

  1. Copy the private key from the output
  2. Paste the content to a file. e.g.: mushop_private_key.pem
  3. Change the permissions to secure the key:
chmod 600 mushop_private_key.pem
  1. Get the public IP address of the compute node
  2. Ssh to the compute node using the key:
ssh -I mushop_private_key.pem opc@<public_ip_address_compute_node>

Note, if you are using the Kubernetes version and want to access the Worker Nodes, may need an additional step. If you select the visibility of your cluster to be "Public", you just need to follow the standard steps. If you select the visibility to be "Private", the worker nodes will not be assigned with a public IP address. You will need a bastion, on the same subnet, to be able to connect. You can follow the steps and create the mushop_private_key.pem inside the bastion and ssh from there.

Learn more about setting up a bastion host