Skip to content

Commit cc3da3d

Browse files
dsshimelclaude
andcommitted
add SSH key authentication sequence diagram to auth flow simulator
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5799c27 commit cc3da3d

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

attendabot/frontend/src/simulations/flowData.ts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,4 +1181,113 @@ export const flows: AuthFlow[] = [
11811181
"Requires browser and OS support (widespread now, but not universal)",
11821182
],
11831183
},
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.",
1248+
payload: `signature = sign(\n challenge: "dGhpcyBpcyBhIHJhbmRvbQ...",\n key: ~/.ssh/id_ed25519\n)\n\n\uD83D\uDD10 If passphrase-protected:\n "Enter passphrase for\n ~/.ssh/id_ed25519: ••••••"\n\n (or ssh-agent provides it)`,
1249+
color: "#a78bfa",
1250+
},
1251+
{
1252+
from: "client",
1253+
to: "server",
1254+
label: "Send signature + public key",
1255+
description:
1256+
"The client sends the digital signature along with which public key it used. The server will check this against its authorized_keys file.",
1257+
payload: `{\n "public_key": "ssh-ed25519 AAAAC3Nz...",\n "signature": "r9Xk2mQ7pLw3n...",\n "algorithm": "ssh-ed25519"\n}`,
1258+
color: "#6c8cff",
1259+
},
1260+
{
1261+
from: "server",
1262+
to: "server",
1263+
label: "Verify signature",
1264+
description:
1265+
"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",
1291+
],
1292+
},
11841293
];

0 commit comments

Comments
 (0)