Ssh is a secure protocol used to manage remote systems like Linux, BSD, UNIX, network devices event windows operating systems. The traffic between systems is encrypted. Ssh uses asymmetric keys in order to encrypt and make traffic invisible to the others who reside between systems in the network. The encryption power comes from key bit size or length. In this tutorial, we will look at how to create 4096-bit keys.
Generate 4098 Bit Key
In this example, we will generate a very secure key. This key size will be 4096 bits. 4096-bit keys are a lot more secure than 2048 or 1024-bit keys. If we are not transferring big data, we can use 4096-bit keys without a performance problem. We will use -b
option in order to specify bit size to the ssh-keygen
.
$ ssh-keygen -b 4096
Generate 4096 Bit DSA Key
RSA
is a very old and popular asymmetric encryption algorithm. It is used in most systems by default. There are some alternatives to RSA like DSA. We can not generate 4096-bit DSA keys because its algorithm does not support them.
Generate 2048 Bit Key
The default key size for the ssh-keygen
is 2048 bit. We can also specify explicitly the size of the key like below.
$ ssh-keygen -b 2048
Generate 1024 Bit Key
The less secure key size is 1024 bit. We do not recommend using this size of keys, but we may need this size of keys in some situations like old systems. Here is how we can generate 1024
bit key with ssh-keygen
.
$ ssh-keygen -b 1024