Cannot setup push mirror using SSH public key

I am trying to setup the code mirror from a repository I have on gitLab to GitHub using the SSH authentication and the public key generated by GitLab. I tried multiple times, but it does not seem to work.

My repositories

For now, I did a manual push to GitHub to get it in sync.

What I did

I configured the mirroring as in the screenshot:

  • Git repository: ssh://git@github.com/marcaurele/flask-servers-testing.git
  • Mirror direction: Push
  • clicked on Detect host keys
  • Authentication method: SSH public key
  • Checked Mirror only protected branches

image

On GitHub, in the settings of the corresponding repository I configured a deploy key using the one provided by GitLab in the little copy icon of the mirroring entry: image

Result

image

The error message is:

13:get remote references: create git ls-remote: exit status 128, stderr: "ssh connect to host github.com port 22: Connection timed out\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n".

I cannot understand what is going wrong as everything seems correct from all the documentation I could find. For the mirroring to GitHub, the official documentation only speaks about the authentication method using Username + Password.

Linked items

  • relates to: #419475 (closed) but the difference is that I want the solution to work with the SSH public key.
Edited by Marc-Aurèle Brothier