Nono.MA

Create an ed25519 SSH key

SEPTEMBER 10, 2022

List existing keys added to the SSH agent.

ssh-add -l
# The agent has no identities.

Create a new EdDSA key1.

ssh-keygen -t ed25519 -C "your@email.com"
# Generating public/private ed25519 key pair.
# Enter file in which to save the key (/Users/john/.ssh/id_ed25519):               
# Enter passphrase (empty for no passphrase): 
# Enter same passphrase again: 
# Your identification has been saved in /Users/john/.ssh/id_ed25519
# Your public key has been saved in /Users/john/.ssh/id_ed25519.pub
# 
# The key fingerprint is:
# SHA256:CPtr5U4xCPT1Ypssz0L/bIn7+l2gNMVe1Bkh2H8tB6w your@email.com
# 
# The key's randomart image is:
# +--[ED25519 256]--+
# |        .o*B= oo.|
# |         *o++= ..|
# |        =.B .+o  |
# |       o B Eo.o  |
# |        S o  +.  |
# |       . .  + .. |
# |        .   .+.o.|
# |           . ++++|
# |            .+*.*|
# +----[SHA256]-----+

Here's how to copy the public key to the clipboard on macOS Terminal.

cat /Users/john/.ssh/id_ed25519 | pbcopy
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMe/yQPuB7k4MO6pL9c+03YHXKc3q/LLvaUED24Vu6P your@email.com

Your public key can be added to services like GitHub or Bitbucket for remote Git pull/push access or Linux machines via SSH.

For instance, you'd add that output as a New SSH Key to GitHub at github.com/settings/keys.


  1. According to Goteleport, "the [key type] choice is between RSA 2048/4096 and Ed25519 and the trade-off is between performance and compatibility. RSA is universally supported among SSH clients while EdDSA performs much faster and provides the same level of security with significantly smaller keys." 

BlogCode