To create an SSH key pair on the command line using
ssh-keygen
:- Open a shell for entering the commands.
- At the prompt, enter the following:
ssh-keygen -t rsa -N "" -b "2048" -C "key comment" -f path/root_name
where the arguments are as follows:-t rsa
Use the RSA algorithm. -N "passphrase"
Passphrase to protect the use of the key (like a password). If you don't want to set a passphrase, don't enter anything between the quotes.Note: While a passphrase is not required, you should specify one as a security measure to protect the private key from unauthorized use.-b "2048"
Generate a 2048 bit key. You don't have to set this if 2048 is acceptable, as 2048 is the default.Note: A minimum of 2048 bits is recommended for SSH-2 RSA.-C "key comment"
A name to identify the key. -f path/root_name
The location where the key pair will be saved and the root name for the files. For example, if you give the root name asid_rsa
, the name of the private key will beid_rsa
and the public key will beid_rsa.pub
.For example,
0 Comments:
Post a Comment