You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Requires browser and OS support (widespread now, but not universal)",
1182
1182
],
1183
1183
},
1184
+
1185
+
// ── SSH Key Authentication ──
1186
+
{
1187
+
id: "ssh",
1188
+
title: "SSH Keys",
1189
+
subtitle:
1190
+
"Public-key authentication for secure remote shell access",
1191
+
entities: [
1192
+
{
1193
+
id: "client",
1194
+
label: "Your Computer",
1195
+
icon: "\uD83D\uDCBB",
1196
+
color: "#6c8cff",
1197
+
},
1198
+
{
1199
+
id: "server",
1200
+
label: "Remote Server",
1201
+
icon: "\uD83D\uDDA5\uFE0F",
1202
+
color: "#4ade80",
1203
+
},
1204
+
],
1205
+
steps: [
1206
+
{
1207
+
from: "client",
1208
+
to: "client",
1209
+
label: "ssh-keygen",
1210
+
description:
1211
+
"You run ssh-keygen on your local machine. This generates a public/private key pair using an algorithm like Ed25519 or RSA. The private key stays on your machine (typically ~/.ssh/id_ed25519). The public key is the part you'll share with servers.",
1212
+
payload: `$ ssh-keygen -t ed25519 -C "alice@laptop"\n\nGenerating public/private ed25519 key pair.\nEnter file: ~/.ssh/id_ed25519\nEnter passphrase: ••••••••\n\n\uD83D\uDD10 Private key: ~/.ssh/id_ed25519\n NEVER leaves your machine.\n\n\uD83D\uDD13 Public key: ~/.ssh/id_ed25519.pub\n Safe to copy anywhere.`,
1213
+
color: "#a78bfa",
1214
+
},
1215
+
{
1216
+
from: "client",
1217
+
to: "server",
1218
+
label: "Copy public key to server",
1219
+
description:
1220
+
"You copy your public key to the server's ~/.ssh/authorized_keys file. This is a one-time setup step — typically done with ssh-copy-id or by pasting it manually. After this, the server knows which public keys are allowed to log in.",
1221
+
payload: `$ ssh-copy-id alice@server.example.com\n\n# This appends your public key to:\n# ~/.ssh/authorized_keys on the server\n\nserver$ cat ~/.ssh/authorized_keys\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5\n AAAAIBt2... alice@laptop`,
1222
+
color: "#6c8cff",
1223
+
},
1224
+
{
1225
+
from: "client",
1226
+
to: "server",
1227
+
label: "SSH connection request",
1228
+
description:
1229
+
"Later, you run ssh to connect. The client initiates a TCP connection to port 22 and they negotiate protocol versions and encryption algorithms. This sets up an encrypted tunnel (using symmetric encryption) BEFORE any authentication happens — so everything from here on is encrypted.",
1230
+
payload: `$ ssh alice@server.example.com\n\n1. TCP connection to port 22\n2. Protocol version exchange\n3. Key exchange (Diffie-Hellman)\n \u2192 Shared symmetric session key\n4. All further traffic is encrypted\n\n\u26A0\uFE0F No authentication yet —\n just an encrypted tunnel.`,
1231
+
color: "#6c8cff",
1232
+
},
1233
+
{
1234
+
from: "server",
1235
+
to: "client",
1236
+
label: "Server sends challenge",
1237
+
description:
1238
+
'The server generates a random challenge (a nonce) and sends it to the client. This is a one-time random value — if the client can sign it with the private key matching one of the authorized public keys, the server will know "this person has the private key."',
1239
+
payload: `Server generates random challenge:\n "dGhpcyBpcyBhIHJhbmRvbQ..."\n\nSends to client:\n "Prove you own a private key\n matching one of the public\n keys in authorized_keys"`,
1240
+
color: "#4ade80",
1241
+
},
1242
+
{
1243
+
from: "client",
1244
+
to: "client",
1245
+
label: "Sign challenge with private key",
1246
+
description:
1247
+
"Your SSH client reads the private key from ~/.ssh/id_ed25519. If the key is passphrase-protected, you're prompted to enter it (or ssh-agent provides it automatically). The client signs the challenge — this produces a signature that only the holder of this private key could create.",
"The server checks: (1) Is this public key in ~/.ssh/authorized_keys? (2) Does the signature verify against the challenge using this public key? If both pass, the server knows the client holds the matching private key — without ever seeing it.",
1266
+
payload: `1. Check authorized_keys:\n "ssh-ed25519 AAAAC3Nz..."\n \u2192 \u2705 Key is authorized\n\n2. Verify signature:\n verify(\n signature,\n challenge,\n public_key\n ) \u2192 \u2705 VALID\n\n\u2714 Client proved key ownership\n\u2714 Private key never left client`,
1267
+
color: "#a78bfa",
1268
+
},
1269
+
{
1270
+
from: "server",
1271
+
to: "client",
1272
+
label: "Shell session granted",
1273
+
description:
1274
+
"Authentication succeeded! The server opens a shell session for the user. All traffic flows over the already-encrypted SSH tunnel. You're now logged in without ever sending a password over the network.",
1275
+
payload: `SSH: Authentication successful.\n\nalice@server:~$ _\n\n\u2714 Encrypted tunnel (AES-256-GCM)\n\u2714 No password sent over network\n\u2714 Private key never left client\n\u2714 Session persists until disconnect`,
1276
+
color: "#4ade80",
1277
+
},
1278
+
],
1279
+
pros: [
1280
+
"No password sent over the network — immune to credential interception",
1281
+
"Private key never leaves your machine — server breach doesn't compromise you",
1282
+
"Can protect the private key with a passphrase + ssh-agent for convenience",
1283
+
"One key pair works across many servers — just add the public key to each",
1284
+
"Foundation for Git over SSH, SCP, SFTP, tunneling, and remote automation",
1285
+
],
1286
+
cons: [
1287
+
"Key management is manual — you must copy public keys to each server",
1288
+
"If you lose your private key (and have no backup), you're locked out",
1289
+
"No central revocation — removing access means deleting the public key from each server's authorized_keys",
1290
+
"Passphrase-less keys are risky if your machine is compromised — anyone who gets the file can use it",
0 commit comments