ed25519
You can generate a strong Ed25519 key using the ssh-keygen utility on Linux Unix or macOS:
- Open a terminal or command prompt on your computer.
- Type the following command to generate a new Ed25519 key pair:
ssh-keygen -t ed25519 -o -a 100
- This will generate a new Ed25519 key pair with a high number of KDF (key derivation function) rounds to increase security. The -o option enables the new private key file format, which uses a stronger encryption algorithm than the older PEM format.
- You will be prompted to choose a filename and location to save the new key pair. You can choose a location and filename that make sense for your needs, or accept the default (~/.ssh/id_ed25519).
- You will also be prompted to enter a passphrase to protect the private key. While this is not strictly necessary, it can provide an extra layer of security in case the key file is ever compromised.
- After you have generated the key pair, you can copy the public key to the remote servers you want to authenticate with by using the ssh-copy-id command. For example:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote-host
- This will copy the public key to the authorized_keys file on the remote server, allowing you to authenticate using the private key.