SSH to a Node in a CaaS Cluster

Table of Contents

Introduction

Learn how to SSH to a node in a CaaS cluster. Although typically most users will use kubectl or the API to interact with a cluster, there are some situations where you may want to connect to a node with SSH.

Note: This is a straightforward process. If you are familiar with the basics, then simply know that you will need to log into the server as the core user with a command such as:

ssh -i ~/.ssh/id_rsa core@104.219.42.000

Requirements

  • A CaaS cluster
  • A Linux server or desktop to SSH from

Download and Install the SSH Keys

Instead of a password, SSH access to a node is authenticated by SSH keys. This helps to keep your CaaS cluster secure.

Log into your account. Go to Organization > Setup.

SSH to a CaaS cluster 1

Scroll down and click the download link for your SSH keypair.

SSH to a CaaS cluster 2

This will download a compressed (zipped) file to your computer containing two files:

  • Your private key: id_rsa
  • Your public key: id_rsa.pub

Upload both files to the ~/.ssh/ directory on your server. If this directory does not exist, create it.

Connect to your server, or open a terminal window on your desktop, and set the permissions for the directory and files with the following commands:

chmod 700 .ssh
chmod 644 .ssh/id_rsa.pub
chmod 600 .ssh/id_rsa

Connect to the Node

To find the public IP for the node, go to Control Plane and click the cluster's name.

SSH to a CaaS cluster 3

Note the Public IP address for the node.

SSH to a CaaS cluster 4

From your SSH or terminal session, connect to the node with SSH using the following command:

ssh -i ~/.ssh/id_rsa core@[public IP address]

For example, if the node's public IP address is 104.100.100.1 the command is:

ssh -i ~/.ssh/id_rsa core@104.100.100.1

You will be authenticated based on the SSH keys, and automatically logged into the node.

Comments

Tags: Containers