Interview Prep/Linux/Networking, SSH & Scheduling

How does SSH public key authentication work?

BeginnerConceptNetworking, SSH & Scheduling
Answer

You generate a key pair; the public key goes into ~/.ssh/authorized_keys on the server. During login the server sends a challenge tied to the session; your client signs it with the private key, and the server verifies the signature with the stored public key. The private key never leaves your machine.

ssh-keygen -t ed25519 -C "aditya@laptop"
ssh-copy-id user@server
All Linux questions Roadmap: Linux

More on Networking, SSH & Scheduling