Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git not using SSH Key to authenticate to Azure DevOps

I recently switched to a new install of Fedora 33 Silverblue running a toolbox. This also happened outside of the toolbox as well. I generated an SSH key using the following command

ssh-keygen -t rsa -b 4096 -C filbot@fenix

Then I uploaded it to Azure DevOps under my account. However, I cannot clone anything from Azure DevOps with the following ~/.ssh/config:

⬢[filbot@toolbox ~]$ cat ~/.ssh/config 
# SSH Configuration File
Host ssh.dev.azure.com
  HostName ssh.dev.azure.com
  User git
  IdentityFile /var/home/filbot/.ssh/id_rsa
  IdentitiesOnly yes
Host vs-ssh.visualstudio.com
  HostName vs-ssh.visualstudio.com
  User git
  IdentityFile /var/home/filbot/.ssh/id_rsa
  IdentitiesOnly yes

Then I ran these git clone commands with the following result:

⬢[filbot@toolbox ~]$ git clone [email protected]:v3/$ORG/$PROJ/Developer.dudleyp.cs_pipeline_tasks
Cloning into 'Developer.dudleyp.cs_pipeline_tasks'...
[email protected]'s password: 

⬢[filbot@toolbox ~]$ GIT_SSH_COMMAND=ssh git clone [email protected]:v3/$ORG/$PROJ/Developer.dudleyp.cs_pipeline_tasks
Cloning into 'Developer.dudleyp.cs_pipeline_tasks'...
[email protected]'s password: 

⬢[filbot@toolbox ~]$ ssh -T [email protected]
Warning: Permanently added the RSA host key for IP address '20.37.158.9' to the list of known hosts.
[email protected]'s password: 

⬢[filbot@toolbox ~]$ ssh -i ~/.ssh/id_rsa -T [email protected]
[email protected]'s password: 

It seems that Git is not respecting or even using the ssh config in my home directory like it did before or in other older installs of Fedora or Pop!_OS. I don't understand why it's doing this now, and how to get the information to figure this out more.

like image 871
FilBot3 Avatar asked May 09 '26 00:05

FilBot3


1 Answers

I had the exact same issue and found a solution here:

Fedora 33 git pull or clone no longer working and/or ssh key no longer recognized

Basically, in your ~/.ssh/config file, under each Host section, add PubkeyAcceptedKeyTypes ssh-rsa.

Host ssh.dev.azure.com
  HostName ssh.dev.azure.com
  User git
  IdentityFile /var/home/filbot/.ssh/id_rsa
  IdentitiesOnly yes
  PubkeyAcceptedKeyTypes ssh-rsa
like image 82
Matt S. Avatar answered May 11 '26 14:05

Matt S.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!