Authentication with GIT

Hello everybody,

I found alot of topics like this but still can't figure out where my exact Problem is.
I already had git set up and running fine but for a while now pushing to my repo is not possible anymore. The Credentials window pops up, I enter my credentials and it comes up agian.

When looking up the response in the network-Tab I can see a 400 with this Message:

{"code":"git_auth_failed","message":"remote: Login failed due to incorrect login credentials or method.\nremote: If you are unsure of which login details or login method to use, visit:\nremote: https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/\nfatal: Authentication failed for 'https://bitbucket.org/myUsername/node-red.git/'\n"}

So I went to the page that is mentioned and logged in. With the exact same credentials I entered in node-red. Works fine.

I am using bitbucket and entered an ssh-key to my account. The same key is also registered within node-red. (Settings->Git-Config->SSH-Keys

I have no clue what I am doing wrong. Any hints?

Best regards,
Pinky

For me it is working with a token. The github password doesn't work. But, if you create a token on github, it does...
On github, when authenticated, go to settings -> Developper settings (last in the menu on the left). Create a token. Use it :slight_smile:

Unfortunatelly I am using bitbucket - and Bitbucket does not support Tokens.

Okay, after digging deeper into the whole thing I connected to the console and fired git from there. Got the same error. So I setup rsa-key verification for the repo and now I was able to push/pull from the console. (Also changed the url of the repo from https to ssh.)

Pushing and pulling from the console works fine now. But I still receive an error message in node-red.
It says:

"Der Repository Host-SchlĂĽssel konnte nicht verifiziert werden. Bitte aktualisieren Sie Ihre known_hosts -Datei und versuchen Sie es erneut."

-> Host key verification can not be done. As I do not receive this error message on the console I think it has something to do with the executing user. Any hints how to solve that?

I guess it depends how you have deployed NodeRed. If you have created a specific user or if you run in docker the ssh keys won't be the same as the ones in the console.

Perhaps this clears it up. The ssh key needs to exist in the known_hosts file.

1 Like

Yeah, that helped somehow.
I already ssh-ed directly via console to bitbucket.org but that only inserted the key to the known_hosts file of the user "pi".

su-ing to the User iobroker is not possible on my system. I already tried adding the key on that way too. What finally worked was: Searching all "known_hosts" files on the System. The user iobroker has one in its home-directory. Root can edit it and adding the key from the link above solved the Problem.

sudo echo "..." does NOT add the key. (No permissions) (Dafuqq?)
sudu su
-> cd /home/iobroker/.ssh
-> nano known_hosts
-> insert key here

bitbucket.org,104.192.143.1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==

Save and you are good to go.
However, it feels like something went wrong in the process here. Shouldn't node-red be able to save the key on its own? Maybe ask if the user shall allow the key?

However - thanks guys!
Working now.

Best regards

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