DEV Community

Pizofreude
Pizofreude

Posted on • Edited on

Generate SSH key pair on Git Bash in 2 Steps

Step 1

Generate a new SSH key pair by running the following command in Git Bash:

ssh-keygen -t rsa -b 4096
Enter fullscreen mode Exit fullscreen mode

This will prompt you to enter a file to save the key to. You can accept the default file location by pressing Enter, or specify a different location by entering the file path and name.

The default directory for saving the SSH key pair when using the ssh-keygen command is ~/.ssh/.

The ~ represents your home directory, and the .ssh subdirectory is where SSH keys are typically stored. So, the default location for saving the SSH key pair would be ~/.ssh/id_rsa for the private key, and ~/.ssh/id_rsa.pub for the public key.

If you do not specify a different location when prompted, the key pair will be saved to these default locations. You can also specify a different location by entering the desired file path and name at the prompt.

Step 2

You will be prompted to enter a passphrase for your SSH key. This is an optional security measure that can help protect your key. You can either enter a passphrase or leave it blank by pressing Enter.

Once the key has been generated, you can view it by running the following command:

cat ~/.ssh/id_rsa.pub
Enter fullscreen mode Exit fullscreen mode

This will display the contents of your public SSH key.

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more