Git SSH keys
SSH keys are used to identify trusted computers without involving passwords. In this article we'll show you how to upload an existing key or generate a new pair, so you can use them to authenticate in your repositories on Buddy.
~/.ssh
. The default name of the key is id_rsa
. You can choose another name if you wish, but it must be reflected accordingly in the configuration.
Adding SSH keys in Buddy
To configure Git SSH keys in Buddy, go to your profile details and click SSH Keys:
Image loading...SSH Keys option on the profile dropdown menu
Click the
+
icon and select whether you want to upload an existing key or generate a fresh pair:Image loading...Adding SSH keys to your Buddy profile
Depending on the chosen option, paste and upload your key, or generate a new pair:
Image loading...Key upload view
Image loading...Key generation view
Generating SSH keys manually
Fire up your console/terminal and type:
ssh-keygen -t rsa -b 4096 -C "your_email@address"
$- Press Enter when prompted to select the default file in which to save the key.
- (Optional) Type passphrase for higher security.
- Review the fingerprint (id) of your key and close the console.
Solving problems with SSH keys
Cannot clone or push/pull repository
If you’re not able to clone or push/pull from the repository, make sure you have configured everything according to the list below:
The file
~/.ssh/config
contains an entry with our service:Host app.buddy.works HostName app.buddy.works User buddy IdentityFile ~/.ssh/id_rsa
Depending on your registration region, the SSH URL to your project looks like this:
buddy@app.buddy.works:WORKSPACE/PROJECT buddy@eu.buddy.works:WORKSPACE/PROJECT
You have properly added the key to the ssh-agent:
ssh-add ~/.ssh/id_rsa
$- The remote address has been properly configured.
The local repository folder contains a hidden
.git
directory with theconfig
file. Make sure the file contains the following entry:[remote "origin"] url = buddy@app.buddy.works:WORKSPACE/PROJECT fetch = +refs/heads/*:refs/remotes/origin/*
Permission denied error
If you’re receiving the following error, it means that the key added to Buddy doesn’t match the key on your computer:
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly
Here’s what you should do:
- Go to your
~/.ssh
folder and double-check if the public key in the folder is the same as the one in Buddy. Run this command to see if Buddy can authenticate properly with the keys:
ssh buddy@app.buddy.works
If everything’s alright, you’ll receive a response of this type:Hi there! You are good to go. Just start pushing and pulling :) Connection to buddy.works closed.
ssh -vvv buddy@app.buddy.works
and send the output to support@buddy.works.
Sep 23, 2024