Skip to content

Cannot use the same deploy key in multiple repositories

I wish to use the same deploy key in multiple repositories. I'm building a Yocto image in my CI and need to have .gitlab-ci.yml checkout multiple private Gitlab repositories that are indicated in a manifest (repo init, repo sync).

I can set a private key in a CI/CD variable and have the CI/CD script use that with ssh-add. When I add the corresponding public key as some Gitlab repository's deploy key, I am able to access that repository.

However, if I try to add the same public key as a deploy key in a second Gitlab repository, I get an error: Fingerprint sha256 has already been taken

I'm generating the key pair with: ssh-keygen -t rsa -b 4096 -C "test"

https://gitlab.com/help shows the Gitlab version to be: 17.5.0-pre ac75753f

Regards, Steve