- From your computer, run the
filenamefor the private key. Also specify the RSA type and a size of 2048.
The command format is:
ssh-keygen -b 2048 -t rsa -f filename
ssh-keygen -b 2048 -t rsa -f mykey
- When prompted, enter a passphrase for the private key, or press Enter to create a private key without a passphrase.
Enter passphrase (empty for no passphrase): YourPassphrase
While a passphrase is not required, Oracle recommends using one as a security measure to protect the private key from unauthorized use. When you specify a passphrase, a user must enter the passphrase every time the private key is used.
- If you provided a passphrase, enter it a second time when prompted.
Enter the same passphrase again: YourPassphrase
ssh-keygen utility creates two files:
filename- The private key
filename.pub- The public key