RSA: It depends on key size. If it has 3072 or 4096-bit length, then you’re good. But 2048 bit keys are indeed acceptable until 2030.
How many bits my ssh key is:
ssh-keygen -l -f ~/.ssh/{key_name}.pub
Create your RSA SSH 4096 bit key:
ssh-keygen -o -t rsa -b 4096 -f ~/.ssh/{key_name} -C "[email protected]"
Create your ed25519 SSH key:
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/{key_name} -C "[email protected]"
-
-o
: Save the private-key using the new OpenSSH format rather than the PEM format. Actually, this option is implied when you specify the key type as ed25519. -
-a
: It’s the numbers of KDF (Key Derivation Function) rounds. Higher numbers result in slower passphrase verification, increasing the resistance to brute-force password cracking should the private-key be stolen. -
-t
: Specifies the type of key to create, in our case the ed25519. -
-f
: Specify the filename of the generated key file. If you want it to be discovered automatically by the SSH agent, it must be stored in the default.ssh
directory within your home directory. -
-C
: An option to specify a comment. It’s purely informational and can be anything. But it’s usually filled with @ who generated the key.
Open your ~/.ssh/config
file, then modify the file to contain the following lines.
Host github.com
IdentityFile ~/.ssh/id_ed25519