🔑ssh-keygen
Also known as ssh-keygen Command, Generate SSH Key, ssh-keygen -t ed25519
The command that makes a new SSH key pair on your computer.
Think of it like
Think of it like a key cutter in a shop. You ask, and it cuts you a new key and its lock.
Example
Jack gets a new laptop. He runs ssh-keygen once, sets a passphrase, and has a fresh key pair in his .ssh folder.
Why it matters
Every key login starts here. Making a key takes a few seconds.
Definition
Example code
console
$ ssh-keygen -t ed25519 -C "jack@laptop"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/jack/.ssh/id_ed25519):Common mistake
Key takeaways
- 1Makes the pair. Private file and .pub file.
- 2Ed25519 by default. Short and strong.
- 3Never overwrite. Old servers still want the old key.