Create a ssh key for your GitLab project on IBM Cloud

This blog post is a short cheat sheet to remember how to configure the access to a GitLab project on IBM Cloud from a local computer. An important part in that situation is you need to configure a ssh key for your computer and save this key in GitLab on IBM Cloud. The remaining parts is how to use GitLab pretty straight forward and good described in the official GitLab documentation. That blog post is related to this blog entry “Example usage of the internal IBM Cloud GitLab instance“.

These are the steps I want to note.

Step 1: Open a terminal and open the .ssh folder on your computer

cd ~/.ssh

Step 2: Create a new SSH key

ssh-keygen -t rsa -C "my_ibm_gitlab_rsa" -f "my_ibm_gitlab_rsa"

  • Example output:
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in my_ibm_gitlab_rsa
Your public key has been saved in
The key fingerprint is:
SHA256:JMxwCMmnRwWqxNkM1jZ+cImY my_ibm_gitlab_rsa
The key's randomart image is:
+---[RSA 3072]----+
|O%=+o            |
|X.Oo=*           |
|.B.=o * .        |
|oEo..= o         |
|=o.*.   S        |
| B               |
| o +             |
|    o            |
|                 |

Step 3: Verify that the files exists

  • Example output:
id_rsa                                  known_hosts.old                              

Step 4: Create a new ssh key on the

Step 5: Open the file with an editor and copy the content of the public key into the new key on for your GitLab project (as you can see above).


Step 6: Add the ssh key to a local config file (see in the documentation generate a ssh key pair

eval $(ssh-agent -s)
ssh-add ~/.ssh/my_ibm_gitlab_rsa

Step 7: Create a new config file

nano ~/.ssh/config

Step 8: Adjust the content for the configfile

# Private GitLab instance
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/my_ibm_gitlab_rsa

Step 9: Ensure you have set the right Git global settings

git config --global "thomas.suedbroecker"
git config --global ""

I hope this was useful for you and let’s see what’s next?



#ibmcloud , #gitlab, #toolchain

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at

Up ↑

%d bloggers like this: