# Project - Git ssh sync with custom port

**URL:** <https://discourse.nodered.org/t/project-git-ssh-sync-with-custom-port/83728>\
**Category:** General\
**Tags:** docker\
**Created:** [14 December 2023 20:51 UTC](https://discourse.nodered.org/t/project-git-ssh-sync-with-custom-port/83728 "2023-12-14T20:51:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadmin91](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sadmin91](https://discourse.nodered.org/u/sadmin91)\
**Post date:** [14 December 2023 20:51 UTC](https://discourse.nodered.org/t/project-git-ssh-sync-with-custom-port/83728/1 "2023-12-14T20:51:42Z")

</div>

Hello,

I have

1. installed NodeRed and Gitea on my local Docker Swarn cluster
2. setup a git key on NodeRed
3. setup the associated public key on Gitea
4. setup a remote repository on NodeRed project with this URL: "ssh://git@_gitHost_:_gitPort_/_gitUser_/_gitRepository_.git"

When I test on the NodeRed container with ssh command, all works fine:

> ssh -i ./_sshKey_ -T -p _gitPort_ git@_gitHost_

But, on NodeRed UI, the connection with remote repository is not possible.  
On browser network tab, an error occurs on "/projects/xxxx/branches/remote" request with the following detail:

> "git@_gitHost_: Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"

I think the porblem occurs because the git server listen on a custom port.  
Could you confirm this?

Many thanks for your help.

---

<div class="post-metadata">

**Author:** ![sadmin91](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sadmin91](https://discourse.nodered.org/u/sadmin91)\
**Post date:** [18 December 2023 20:31 UTC](https://discourse.nodered.org/t/project-git-ssh-sync-with-custom-port/83728/2 "2023-12-18T20:31:59Z")

</div>

Hello everybody,

I have found a workaround for this behaviour:  
On NodeRed container, I clone the desired Git repository with the "git clone" command on the "/data/projects" folder and then I can sync via ssh protocol on NodeRed UI.

For your information, you can find the complete git command:

> git clone ssh://git@_gitHost_:_girPort_/_gitRepo_.git --config core.sshCommand="ssh -i _sshKey_"

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 January 2024 20:32 UTC](https://discourse.nodered.org/t/project-git-ssh-sync-with-custom-port/83728/3 "2024-01-01T20:32:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
