Intermediate Reading #tutorial #howto #ssh

Reading Tutorials & How-Tos

5 exercises on step-by-step technical guides — SSH key authentication and Python virtual environments. Read for sequence, prerequisites, conditions, and the all-important gotchas.

Reading step-by-step guides effectively
  • Prerequisites — what you need before Step 1; skipping these is the top cause of failure
  • Sequence gates“Do NOT proceed until...” marks a condition that must be true first
  • Platform branches — match the command to your OS, not the first line you see
  • “Common gotcha” / WARNING — the trap others fall into; read these twice
  • Purpose of a precaution — ask “what bad outcome does this prevent?”
0 / 5 completed
1 / 5
Passage: SSH Key Setup — How-To Guide
Title: How to Set Up SSH Key Authentication for a Remote Server

Prerequisites: You need terminal access on your local machine and an existing way to
log in to the server (usually a password). This guide assumes OpenSSH, which ships with
macOS, Linux, and modern Windows.

Step 1 — Generate a key pair on your LOCAL machine (not the server):
    ssh-keygen -t ed25519 -C "you@example.com"
  Press Enter to accept the default location (~/.ssh/id_ed25519). You may set a
  passphrase for extra security; if you do, you will be prompted for it when the key
  is first used in a session.

Step 2 — Copy the PUBLIC key to the server:
    ssh-copy-id user@your-server-ip
  This appends your public key to ~/.ssh/authorized_keys on the server. You will be
  asked for your password one last time.

Step 3 — Test the connection:
    ssh user@your-server-ip
  If everything worked, you log in without a password (or with only your key
  passphrase). Do NOT proceed to Step 4 until this works.

Step 4 — (Optional but recommended) Disable password login on the server:
  Edit /etc/ssh/sshd_config and set:
    PasswordAuthentication no
  Then restart SSH: sudo systemctl restart ssh

  WARNING: If your key is not working and you disable password login, you will lock
  yourself out. Always confirm Step 3 succeeds first. Keep a second terminal session
  open while you test, so you are not relying on a single connection.

Common gotcha: If the server rejects your key, check that ~/.ssh on the server is
mode 700 and authorized_keys is mode 600. SSH silently refuses keys in
world-readable files as a security measure.
According to the guide, what must you confirm before disabling password login in Step 4?