Create an Ed25519 key
Create an Ed25519 key pair with ssh-keygen -t ed25519. Name the file with -f, label it with -C, and set a passphrase instead of the empty one used here.
You need a new SSH key, and Ed25519 is the type to pick unless a server forces something else.
ssh-keygen -q -t ed25519 -f ./demo_key -C '[email protected]' -N ''
ls -l demo_key demo_key.pub | awk '{print $1, $5, $9}'
cut -d' ' -f1,3 demo_key.pub-rw------- 411 demo_key
-rw-r--r-- 99 demo_key.pub
ssh-ed25519 [email protected]-t ed25519 picks the key type, -f names the private file and writes the public one beside it with .pub added, and -C sets the comment at the end of the public line. Ed25519 keys are short, fast to verify and have no size to choose, which is the argument made in the ssh-keygen manual. The permissions on the private file are set to 600 for you, as the first column shows.
-N '' means no passphrase and is used here only so the example runs without a prompt. Leave the option out on a real key and ssh-keygen asks for one, or the file on disk is all an attacker needs. Ed25519 needs OpenSSH 6.5 or later on both ends, and a few old appliances still accept only RSA.