Create a key pair for ssh RSA 4096 bits ssh-keygen -b 4096 ECDSA ssh-keygen -t ecdsa -b 521 ssh-keygen -t ed25519 Key format Note that the commands above issue OpenSSH Format (starts with -----BEGIN OPENSSH PRIVATE KEY-----). Some SSH client can’t read this format, and in that case, append -m PEM option.
ssh-keygen -t rsa -b 4096 -m PEM Create only a RSA private key and out the public key openssl genpkey -algorithm RSA -out .