# GIT project clone "Authentication failed"

**URL:** https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953
**Category:** General
**Created:** [17 November 2023 02:20 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953 "2023-11-17T02:20:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alexgorbatchev](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alexgorbatchev/32/84936_2.png) [@alexgorbatchev](https://discourse.nodered.org/u/alexgorbatchev)
#### Post date: [17 November 2023 02:20 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953/1 "2023-11-17T02:20:47Z")

</div>

Hi friends,

I've been trying to figure this out for days.

**Problem:**

- I have a node-red `v3.1.0` and gitea `v1.21.0` running in a Kubernetes cluster.
- I'm adding public/private keys to node-red via a secret and gitea user has the same public key verified.
- Key doesn't have a passphrase.
- Attempting to clone the repo project from node-red fails with "Authentication failed".

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/9778401bd1425c1cd22fdebbb48091e1446f28e6.png)

**Validation:**

1. I have logged into the node-red pod and able to SSH into the Gitea SSH using the key from the `/data/projects/.sshkeys` folder:

2. I have logged into the node-red pod and can clone the target repo using the key from the `/data/projects/.sshkeys` folder:

3. Using the same key from the UI doesn't work, there are no logs produced by node-red in this case.

Does anyone know what am I doing wrong here?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [17 November 2023 13:57 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953/2 "2023-11-17T13:57:15Z")

</div>

> [@alexgorbatchev](#):
>
> `__default_gitea`

Have you tried that id? It isn't the one in the image you shared.

---

<div class="post-metadata">

### Author: ![alexgorbatchev](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alexgorbatchev/32/84936_2.png) [@alexgorbatchev](https://discourse.nodered.org/u/alexgorbatchev)
#### Post date: [17 November 2023 16:59 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953/3 "2023-11-17T16:59:08Z")

</div>

Thank you for response! When I created an SSH key manually from node-red with the `gitea` name, the file that it generated was `/data/projects/.sshkeys/ __default_gitea`. So I think that's the node-red naming convention and in the UI it is displayed without the `__ default_` prefix. To summarize, the key in the screenshot is the `__default_gitea` file.

---

<div class="post-metadata">

### Author: ![alexgorbatchev](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alexgorbatchev/32/84936_2.png) [@alexgorbatchev](https://discourse.nodered.org/u/alexgorbatchev)
#### Post date: [22 November 2023 17:43 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953/4 "2023-11-22T17:43:42Z")

</div>

I've found a workaround of sorts. From the pod shell:

```shell
cd /data/projects
GIT_SSH_COMMAND="ssh -i /data/projects/.sshkeys/__default_gitea" git clone git@.../node-red.git
chown -R /data/projects/node-red node-red

```

After that, it's possible to then open exiting project via node-red UI and it appears that pull/push just works.

The conclusion here IMO is that the `git clone` in the initial project setup isn't working in my case for some reason.

---

<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: [21 January 2024 17:44 UTC](https://discourse.nodered.org/t/git-project-clone-authentication-failed/82953/5 "2024-01-21T17:44:22Z")

</div>

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