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 Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more