Beginner Package: openssh-client

ssh-keygen

Generate SSH key pairs for passwordless, key-based authentication.

Syntax

ssh-keygen [options]

Description

ssh-keygen creates a public/private key pair used for authenticating to remote systems without a password, which is both more secure and more convenient than password-based SSH login once set up.

Examples

ssh-keygen -t ed25519 -C "me@example.com"
Generate a modern ed25519 key pair with a comment
ssh-copy-id user@server
Copy your public key to a remote server's authorized_keys
ssh-keygen -l -f ~/.ssh/id_ed25519.pub
Show the fingerprint of an existing key

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux