I just upgraded my desktop to Ubuntu 22.04. When I attempt to push to one of my git repos on AWS CodeCommit (using ssh) I get:
$ git push origin master
Unable to negotiate with 52.94.226.180 port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If I try the same thing on a computer that uses the previous version of Ubuntu, using the same keys and ssh configuration, the push succeeds:
$ git push origin master
[master 879fbb1] -
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100755 Blah.pdf
To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/my_repo
e360ec8..879fbb1 master -> master
I added HostKeyAlgorithms +ssh-rsa
to the entry in ~/.ssh/config
, so it looks like this:
Host git-codecommit.*.amazonaws.com
HostKeyAlgorithms +ssh-rsa
IdentityFile ~/.ssh/codecommit_rsa
User XXXXXXXX
Now I get a different error:
$ git push origin master
APKAIKOVHJDF7L22TRPA@git-codecommit.us-east-1.amazonaws.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Maybe this might help?
$ sudo scanssh -s ssh 52.94.226.180
52.94.226.180:22 SSH-2.0-AWSCodeCommit VGh1LCAyOCBBcHIgMjAyMiAyMDozOToyMSArMDAwMFRE84lk14QcsWNrhwqxNLNmRuhBFhi2T0uc9R+6yS0sQklQWVZaOGpobGJHYWdvUER3MHhUVTYzY3c5SzlXSEFNOTRYNWdKMW0yY3M9
Effective host scan rate: 1.02 hosts/s