liveBook · Manning

Public key

As explained in Road to Kubernetes

A public SSH key is the shareable half of an SSH key pair used by a remote system to authenticate the corresponding private key.

A public SSH key is the shareable half of an SSH key pair. Store the private half as a protected GitHub Actions secret, and install the public half on the remote virtual machine. section 4.1.2

Use a purpose-built public key when automating access:

  • Generate a separate pair for GitHub Actions instead of exposing a personal private key. section 4.1.2
  • Paste github_actions_key.pub into the Akamai Connected Cloud SSH Keys console. section 4.1.3
  • Keep github_actions_key, without the .pub suffix, in the SSH_PRIVATE_KEY repository secret. section 4.1.2
  • Connect without a password when the private key is available to the workflow and the public key is installed remotely. section 4.1.5

Automated NGINX installation

A GitHub Actions workflow writes its stored private key to ~/.ssh/id_rsa, applies chmod 600, and uses the matching public key already installed on the remote instance. It then connects through SSH and runs apt update followed by apt install nginx -y. section 4.1.5

Listing 4.3 Creating a new SSH key
# windows/mac/linux
ssh-keygen -t rsa -b 4096 -f github_actions_key -N ""

Generate the matching private and public files with ssh-keygen before distributing them to GitHub Actions and the cloud provider. section 4.1.2

How Road to Kubernetes covers it

How deep it goes
Defines the key pair, demonstrates generation and console installation, and defers deeper SSH-key treatment to appendices.
Examples
Uses github_actions_key.pub, the Akamai SSH Keys console, and an NGINX installation workflow.
What it assumes
Teaches the public/private distinction through key generation while relying on access to GitHub repositories and Akamai Connected Cloud.
What you can do after
Operate/configure passwordless SSH by installing a public key on instances for GitHub Actions access.
How it connects
Connects SSH key pairs, GitHub Actions secrets, virtual machines, and passwordless SSH.

Also explained in

Compare how 8 books explain public key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.