Create an SSH key pair with ssh-keygen (Ed25519)
Generate a modern Ed25519 public/private key pair in ~/.ssh for authenticating to servers and Git platforms without passwords.
01Command
$ ssh-keygen -t ed25519 -C "user@machine"02What it does
The -C comment is just a label (commonly user@host) that helps you tell keys apart later; the tool prompts for an optional passphrase, which is worth setting because it protects the key if the machine is stolen. The .pub file is what you install on servers: ssh-copy-id user@server appends it to the server's ~/.ssh/authorized_keys, or paste it into a Git host's SSH settings. ssh-keygen only creates keys — it does not install them anywhere. For very old servers that lack Ed25519 support, fall back to ssh-keygen -t rsa -b 4096. List your keys with ls ~/.ssh/*.pub.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- ssh-keygen(1) — OpenSSH authentication key utilityEvidence: The ssh-keygen man page documents -t to select the key type (including ed25519) and -C to provide a new comment.
- OpenSSH - ArchWikiEvidence: The ArchWiki OpenSSH page recommends ssh-keygen -t ed25519 for generating Ed25519 keys and describes copying the public key to servers with ssh-copy-id.
Last verified: 2026-09-17 · Category: Security & Privacy
06Related solutions
Find every occurrence of a pattern across all files in a tree, printed as file:line:number matches.
Add or remove read, write, and execute permission for the owner, group, or others using symbolic or octal modes.
Refresh the package index from all configured repositories, then install newer versions of every upgradable package.