🔐 SSH Key Generation Guide - n0one42/ansible-homelab GitHub Wiki

📚 Table of Contents

🌟 Overview

This section provides a step-by-step guide on generating SSH keys. SSH keys are essential for secure communication and authentication between your control node and the Proxmox servers and VMs.

📋 Prerequisites

  • A terminal application (Linux, macOS, or Windows with a compatible terminal emulator)
  • Basic understanding of terminal commands

🔒 SSH Key Generation Methods

Standard SSH Key Generation

  1. Open a terminal on your local machine.
  2. Run the following command to generate a new SSH key pair:
ssh-keygen -o -a 100 -t ed25519 -C "HomeLab" -f ~/.ssh/id_ed25519
  1. When prompted, you can enter a secure passphrase. However, for demonstration purposes and based on our security requirements, we’ll leave the passphrase empty. Simply press Enter to skip the passphrase.
  2. Your SSH keys will be generated in the location ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub.

SSH Key Generation with YubiKey

🪟 Windows (W.I.P)
🍏 MacOS (W.I.P)
🐧 Arch Linux

Requirements

  • YubiKey with FIDO2 support

  • Packages

    • sudo pacman -S libfido2

Generating a FIDO2 SSH Key

  1. Plug in your YubiKey.

  2. Generate a new SSH key:

    ssh-keygen -t ecdsa-sk -O resident
    # Alternative (but recommended)
    ssh-keygen -t ecdsa-sk -O resident -O application=ssh:HomeLab -C "HomeLab"
  3. Follow the prompts to touch your YubiKey and optionally set a passphrase.




🔍 Verifying SSH Key Generation

After generating the SSH keys, you can verify their existence by listing the files in the .ssh directory:

ls -l ~/.ssh/id_*

You should see the following output (or similar):

-rw------- 1 user user  411 Dec  1 12:34 /home/user/.ssh/id_ed25519
-rw-r--r-- 1 user user  101 Dec  1 12:34 /home/user/.ssh/id_ed25519.pub

This confirms that your SSH keys have been generated and are ready for use.

For more detailed information on using SSH keys with your Proxmox setup, refer to the Setup Guide.

⚠️ **GitHub.com Fallback** ⚠️