How to create SSH keys

Modified on Wed, 13 Oct 2021 at 08:32 PM

Windows

Step 1 Open Git Bash

Step 2 Execute the following command. Replace your@email.com with your own email address.

ssh-keygen -t rsa -b 4096 -C "your@email.com"

The command will ask you the following. Press enter.

Enter a file in which to save the key

The command will ask you to enter a passphrase. You can leave this empty, but anyone with the keys can use it. We recommend to use a strong passphrase. You will need to enter this with every new SSH connection.

Enter passphrase (empty for no passphrase):

Repeat the passphrase:

Enter same passphrase again:

Step 3 Get your public SSH key using the following command:
cat ~/.ssh/id_rsa.pub

MacOS

Step 1 Open terminal

Step 2 Execute the following command. Replace your@email.com with your own email address.

ssh-keygen -t rsa -b 4096 -C "your@email.com"

The command will ask you the following. Press enter.

Enter a file in which to save the key

The command will ask you to enter a passphrase. You can leave this empty, but anyone with the keys can use it. We recommend to use a strong passphrase. You will need to enter this with every new SSH connection.

Enter passphrase (empty for no passphrase):

Repeat the passphrase:

Enter same passphrase again:

Step 3 Get your public SSH key using the following command:
cat ~/.ssh/id_rsa.pub

Linux

Step 1 Open terminal

Step 2 Execute the following command. Replace your@email.com with your own email address.

ssh-keygen -t rsa -b 4096 -C "your@email.com"

The command will ask you the following. Press enter.

Enter a file in which to save the key

The command will ask you to enter a passphrase. You can leave this empty, but anyone with the keys can use it. We recommend to use a strong passphrase. You will need to enter this with every new SSH connection.

Enter passphrase (empty for no passphrase):

Repeat the passphrase:

Enter same passphrase again:

Step 3 Get your public SSH key using the following command:
cat ~/.ssh/id_rsa.pub

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article