ssh-keygen

, and SSH,

Syntax

ssh-keygen [options]

Parameters

ParametersDescriptionExamplesLevel
-t (ed25519/rsa/ecdsa) ssh-keygen -t ed25519 Common
-C () ssh-keygen -t ed25519 -C "dev@example.com" Common
-f ssh-keygen -t ed25519 -f ~/.ssh/github_key Common
-b (RSA 4096) ssh-keygen -t rsa -b 4096 Common
-N (passphrase) ssh-keygen -t ed25519 -N "mypassphrase" Advanced
-R known_hosts ssh-keygen -R 192.168.1.100 Advanced

Examples

Ed25519 (Recommended)

ssh-keygen -t ed25519 -C "your@email.com"
Ed25519,

RSA 4096

ssh-keygen -t rsa -b 4096 -C "your@email.com"
, ed25519

ssh-keygen -t ed25519 -f ~/.ssh/work_key -C "work@company.com"

known_hosts

ssh-keygen -R 192.168.1.100

Common Errors

Overwrite (y/n)?, n, -f New
Permissions 0644 for 'id_rsa' are too open, chmod 600 ~/.ssh/id_rsa

Tips

Related Commands