Git Integration Authentication with SSH Keys

Starting from version 7.0.0, Katalon Studio supports connecting to Git with SSH Keys.

In Katalon Studio, you can generate and add SSH keys to SSH agents without coding. With SSH keys, you can clone your Katalon Studio Project from cloud-hosted services of Git and integrate them with Katalon Studio. Cloud-based Git services include:

  • GitHub
  • GitLab
  • BitBucket
  • Microsoft Azure DevOps

In this tutorial, you will learn how to generate SSH keys and clone a repository from cloud-hosted services of Git with an SSH protocol.

Requirements:

  • An active Katalon Studio Enterprise license.
  • An existing cloud-based Git repository for your projects. You can download or clone our CI sample project from our Github repository: CI sample.
  • An existing account for your Git repository of choice.

Generate SSH keys

  1. To configure options for SSH, in Katalon Studio > Preferences, go to General > Network Connection > SSH2.

  2. Manage your SSH keys:

    In the General tab, you can manage your SSH home directory and which private key you are using.

    For example, the SSH is usually located at :/Users/your_user_name/.ssh or C:\Users\your_user_name\.ssh). The .ssh folder contains your SSH private and public keys, for example: id_rsa or id_rsa.pub.

    In the Private keys section, you can view or delete the old keys and only keep the ID key you use.

    SSH URL
  3. Generate new SSH keys:

    In the Configuration options for SSH2 section, select the Key Management tab.

    You can check if you already have an existing SSH key by clicking Load Existing Key. This action opens your .ssh folder.

    load existing key

    To generate a new SSH key, select Generate DSA Key or Generate RSA Key and copy the generated key to your clipboard.

    rsa key

    You can also generate an RSA key with this command:

    ssh-keygen -m PEM -t rsa -b 2048 -C "your_email@example.com"

    Notes:

    • Katalon Studio only supports OpenSSL, not OpenSSH formats.
  4. Add your SSH key to the SSH agent:

    Enter the Passphrase or leave it empty, then click Save Private Keys. Enter the file name and click Save. A new private and a new public key are generated.

Add a new SSH key to your Git account

In GitHub

  • Go to your Git Account > Settings > SSH and GPG keys and click New SSH key. The SSH keys / Add new page appears.

  • Enter the Title and paste your Key, then click Add SSH key.

    add new SSH key

In Bitbucket

  • Go to Your profile and settings > Personal settings > SSH keys and click Add key. The Add SSH key dialog appears.

  • Enter the Label and paste your Key, then click Add key.

    Bitbucket

In Azure DevOps

  • Go to User Settings > SSH Publics key and click New Key. The Add New SSH Key dialog appears.

  • Enter the Name and paste your Public Key Data, then click Add.

    ADO

In GitLab

  • Go to User Settings > SSH key.

  • Enter the Title, set the expiration date and paste your Key. Then, click Add key.

    GitLab

Clone your Project with a SSH Protocol

First, you need to enable Git Integration. See Configure Git Integration.

After enabling Git Integration, you can clone an existing Git repository into a newly-created directory on the local machine.

How to get SSH Protocol?

Go to your account on GitHub, GitLab, Bitbucket, or Azure DevOps, then go to the repository you want to clone to Katalon Studio. Click Clone and select SSH, then copy the SSH Protocol.

  1. In the main toolbar, click on the Git icon and select Clone Project.

    Clone Project

    The Clone Git Repository dialog is displayed. Enter a repository URL with SSH Protocol and click Next.

    source git repository
  2. Enter the passphrase, if any, then click OK. The Branch Selection screen appears.

    Enter the passphrase
  3. Choose the branches you wish to check out as local branches. Click Next to continue. The Local Destination appears.

    choose local branches
  4. Specify the local location for cloning as well as the initial branch.

    specify the local location for cloning
    • Directory: the local storage location you want to store your Git repository.
    • Initial branch: all selected branches from the previous step are displayed here. Select the branch to be used initially from this list.
  5. Click Finish when you are done. Katalon Studio automatically opens your cloned project.

  6. To verify settings, go to Katalon Studio> Preferences > Team > Git > Configurations > Repository Settings. Ensure that the repository is selected correctly with the URL specified.

    verify settings

After successfully cloning your repositories, you can commit, pull, and push changes to the repositories from Katalon Studio. To learn more about how to integrate with Git, see Git Integration.

Feedback