Menu & Search
Setup SSH Keys in WSL

Setup SSH Keys in WSL

Setup SSH Keys in WSL with Bitbucket.

# Create New SSH Key
# Add SSH Key to Agent
# Add SSH Key to Project


Create New SSH Key

I’m creating a new SSH key within a linked folder, which means my SSH keys are backed up on the local machine in-case anything happens on this WSL instance… even though in this case I can easily recreate & re-add to my account if need be.

Create the key with a password and we’ll add it to agent in the next step so that we don’t need to enter it everytime.

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

Add SSH Key to Agent

As mentioned above by adding our new SSH key to the ssh-agent so we don’t have to enter the passphrase everytime we use it.

eval $(ssh-agent -s)
ssh-add pw_bitbucket

Add SSH Key to Project

Now that the SSH key is ready, we just need to add that to the Git account you’re using. I’m using Bitbucket here.

Get the contents of the public SSH key with the Linux cat command. Copy everything except the email at the end.

Below is an example of when you haven’t added the SSH key to your account yet.

ssh -T git@bitbucket.org

Now add the key to your account.

Connect to Bitbiucket.

Get the git clone repo link.

Clone the repo.

Open Visual Studio Code or whichever editor you prefer.

And there we go.


Share

1 Comment

  1. […] This assumes SSH keys are set-up. […]