$
Learn Linux handbook
en
XP:0
Quest 142Key Master
+220 XP

SSH Key Authentication (ssh-keygen & ssh-copy-id)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

Password authentication on remote SSH servers is vulnerable to brute-force attacks and credential stuffing. Production infrastructure relies on asymmetric SSH keypair authentication.

- ssh-keygen -t ed25519: Generates a high-security Ed25519 public/private keypair (~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub).
- ssh-copy-id deployer@192.168.1.50: Automatically appends your local public key to the remote user's ~/.ssh/authorized_keys file, enabling passwordless login.

Let's set up key-based authentication. Generate an Ed25519 SSH keypair by running ssh-keygen -t ed25519, then install your public key onto the remote host using ssh-copy-id deployer@192.168.1.50.

Command Syntax Reference

Command / SyntaxDescription
ssh-keygen -t ed25519Generate Ed25519 SSH cryptographic keypair
ssh-copy-id user@hostCopy public key to remote host authorized_keys

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Generate SSH keypair with ssh-keygen
  • ○
    Install public key with ssh-copy-id

Ready to complete Quest 142?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.