ssh-keygen Command Generator
Generate ssh-keygen commands to create SSH keys
Getting Started with ssh-keygen
## What is ssh-keygen?
`ssh-keygen` creates SSH key pairs (a private key and a public `.pub` key). You then place the public key on remote hosts to log in without a password.
## How to Use
1. **Pick a Type**: `ed25519` (recommended) or `rsa`. 2. **Set the File**: where to save the key, e.g. `~/.ssh/id_ed25519`. 3. **Add a Comment** (optional): a label like `user@host`. 4. **Copy & Run**: paste the generated command, then set a passphrase when prompted.
Flags & Patterns
``` ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 ssh-keygen -t rsa -b 4096 -C me@host ```
### Common flags - `-t <type>` — key type: `rsa`, `ed25519`, `ecdsa` - `-b <bits>` — key size (for RSA/ECDSA; e.g. 4096) - `-f <file>` — output key file - `-C <comment>` — comment/label (shown in the .pub file)
### Tips - Prefer `ed25519`: shorter, faster, and as secure as a large RSA key. - Use `-f` to avoid the interactive prompts and script key creation.
▶Which key type should I use?
▶How do I install the key on a remote host?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee