Create Technical Users for ssh-based git access

Last modified by DevOps-as-a-Service Operator on 2025/02/05 11:33

Bitbucket supports using ssh keys (only DSA and RSA2) as technical user. You can give read-only or read/write access to one or multiple ssh keys for a complete project or only a single repository. The advantage is that for this type of technical user you don't need to spend a Bitbucket license. The disadvantage is that only works for ssh-based git access. Since it can't be used for https you can't do git LFS or call the Bitbucket API. If you want to do this created a technical user on Bitbucket as described on DevOps Portal for Admins.

The following steps describe how to set up such a technical user and use it for example in Jenkins to be able to use git clone. Please note you are not required to do this for the Jenkins provided by DevOps-as-a-Service since all projects will be automatically connected for you.

  1. For Linux or MacOS, create an ssh key using ssh-keygen on the command line:

    ssh-keygen -t dsa -b 1024 -C sdcloud@t-systems.com -f /<path-to-my-project>/<myproject>-jenkins.dsa [-N <password>]
  2. For Windows, the PuTTY Key Generator (puttygen.exe) can be used. The public key for Bitbucket can be copied directly from the window. The private key for Jenkins has to be saved using Conversions/Export OpenSSH key as a *.pem file. Use a passphrases to improve security!

    image2019-2-22_15-32-50.png

  3. Add public key (<myproject>-jenkins.dsa.pub) to the Bitbucket repository:

    create-technical-user-01.PNG
     
  4. Select "Read" and press "Add key":
    create-technical-user-02.PNG
     
  5. Enter the private key (<myproject>-jenkins.dsa) into Jenkins in the domain git-repositories and specify the key password too:
    create-technical-user-03.PNG