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:
- I made sure user.name and user.email are correctly set in git config and verified using "git config --global --list"
- 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.
ssh -Torssh -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.eval "$(ssh-agent -s)"&ssh-add ~/.ssh/id_rsa_newYou probably want to know: (1) where is your git binary (where git) and (2) where is yourssh-agentyou're executing (which ssh-agent). Also did you upload your key to GitLab? I recommend following the docs carefullyssh -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-rsato git config file.