0

The situation:

Existing user/repository/git remote server, setting up environment on a new pc using git for windows.

The problem:

When I try to do basic git commands in git bash that require access permissions, I get the prompt:

[email protected]'s password:

Which in my experience means that the SSH connection using RSA key isn't set up correctly.

Steps I already took:

  1. I made sure user.name and user.email are correctly set in git config and verified using "git config --global --list"
  2. I tried re-generating a ssh_key running and adding to gitlab. then saved it to another file (not the default id_rsa). then added using the steps : eval "$(ssh-agent -s)"&ssh-add ~/.ssh/id_rsa_new
    Which got successful "Identity added: "

Manually adding credentials is problematic security wise so I rather not go there.

I've done this setup process many times and am baffled what could be the cause for the SSH connection not working seamlessly.

4
  • 1
    The usual diagnostic is to run ssh -T or ssh -Tv (add more "v" letters for more verbosity): ssh -T [email protected] will test out the ssh connection without involving Git at all. If that works the way you want, then on Windows, the usual problem is that Git and Windows each come with their own ssh, and one is set up correctly and the other is not, so convince Git to use the correct ssh and/or set up the other one too. Commented Nov 1, 2021 at 22:37
  • If that doesn't work the way you want—e.g., if it demands a password or pass-phrase on the wrong system, despite having the agent running—you can debug from there without Git in the way. Commented Nov 1, 2021 at 22:38
  • It sounds like you may have multiple OpenSSH / bash / git installations as torek mentioned. How are you accessing git? How did you run eval "$(ssh-agent -s)"&ssh-add ~/.ssh/id_rsa_new You probably want to know: (1) where is your git binary (where git) and (2) where is your ssh-agent you're executing (which ssh-agent). Also did you upload your key to GitLab? I recommend following the docs carefully Commented Nov 3, 2021 at 21:24
  • As per @torek suggestion, I used ssh -Tv [email protected] to see why it failed using the ssh key. The error was: debug1: send_pubkey_test: no mutual signature algorithm . This was solved in my case by adding: PubkeyAcceptedKeyTypes +ssh-rsa to git config file. Commented Jan 17, 2022 at 13:41

1 Answer 1

2

The comments led to an answer:

As per @torek suggestion, I used ssh -Tv [email protected] to see why it failed using the ssh key. The error was: debug1: send_pubkey_test: no mutual signature algorithm. This was solved in my case by adding: PubkeyAcceptedKeyTypes +ssh-rsa to git config file.

Technically, you added this to your ssh configuration, not your Git configuration. (You can set up the same bypass trick via Git, but the spelling is different.)

This means your server (not client) is at fault here: it is using a weak SSH RSA public key. See https://www.openssh.com/txt/release-8.2 and/or https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html for additional information.

If possible, you should upgrade the ssh server on the server system.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.