Knowledge

How to configure and solve problems with SSH keys?

SSH keys are used to identify trusted computers without involving passwords. In Buddy you can either use your existing keys with or generate a new pair. Here's how:

Generating SSH keys in Buddy

  1. Click your avatar, top-right to bring up the profile sidebar
  2. Click Manage your profile... (alternatively, type /my-id after your domain)
  3. Go to SSH keys and click Add a new SSH key
  4. Proceed with the security check
  5. Click the link below the empty field to generate a new pair of SSH keys.
  6. (Optional) Type passphrase for higher security
  7. Unpack the files in your ~/.ssh directory. Create the directory in case it doesn't exist

Buddy will automatically upload the public key to the service - you don't have to add it manually.

You can add the passphrase to your keychain so that you don't have to type it every time you try to reach your repositories.

Generating SSH key
Generating SSH key

Generating SSH keys manually

  1. Fire up your console/terminal and type:

    ssh-keygen -t rsa -b 4096 -C "your_email@address"
    
  2. Press Enter when prompted to select the default file in which to save the key
  3. (Optional) Type passphrase for higher security
  4. Review the fingerprint (id) of your key and close the console

Adding existing SSH keys to Buddy

  1. Click your avatar, top-right to bring up the profile sidebar
  2. Click Manage your profile... (alternatively, type /my-id after your domain)
  3. Go to SSH keys in the Settings tab and click Add a new SSH key
  4. Paste the contents of your public key or click upload the key from disk at the top
  5. (Optional) Provide Title for identification
  6. Hit Create a new key to add the key to Buddy
Adding existing SSH key
Adding existing SSH key

Solving problems with SSH keys

The default path to the keys and configuration file is ~/.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 configuration.

If you're not able to clone or push/pull from the repository, make sure you have configured everything according to the list below:

  1. File ~/.ssh/config should contain an entry with our service:

    Host app.buddy.works
    HostName app.buddy.works
    User buddy
    IdentityFile ~/.ssh/id_rsa
    
  2. The SSH URL to your project looks like this (HTTP URL will not work):

    buddy@app.buddy.works:WORKSPACE/PROJECT
    
  3. The key has been added to the ssh-agent:

    ssh-add ~/.ssh/id_rsa
    
  4. The remote address has been properly configured in the repository. The local repository folder contains a hidden .git directory with config file. Make sure the file contains the following entry:

    [remote "origin"]
       url = buddy@app.buddy.works:WORKSPACE/PROJECT
       fetch = +refs/heads/*:refs/remotes/origin/*
    

Get started now

14 days of unlimited trial. No credit card required.