AWS CodeCommit升级到Ubuntu 22.04(Jammy)后,无法通过SSH进行身份验证
我刚刚将桌面升级到Ubuntu 22.04。当我尝试在AWS CodeCommit上推到我的一个git存储库(使用SSH)时,我会得到:
$ 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.
如果我在使用以前版本的Ubuntu的计算机上尝试相同的内容,使用相同的键和SSH配置,则推动成功:
$ 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
我在〜/.ssh/config
中的条目中添加了hostkeyalgorithms +ssh-rsa
,所以看起来像这样:
Host git-codecommit.*.amazonaws.com
HostKeyAlgorithms +ssh-rsa
IdentityFile ~/.ssh/codecommit_rsa
User XXXXXXXX
现在我遇到了一个不同的错误:
$ git push origin master
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
也许这可能会有所帮助?
$ 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
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
[email protected]: 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将行
PubKeyAcceptedKeykeyTypes +ssh-rsa
以及您的输入到您的〜/.ssh/config
,因此看起来像这样:有关此问题的更多信息:
ubuntu 22.04带有新版本的SSH(OpenSSH8.9P1)的船只,而先前的Ubuntu版本使用了OpenSSH8.4P1或以上。
OpenSSH8.8P1发生了破坏的变化,默认情况下,使用SHA-1哈希算法禁用RSA签名。
来自 openssh发行说明
Add the line
PubkeyAcceptedKeyTypes +ssh-rsa
as well to your entry to your~/.ssh/config
, so it looks like this:More Information about the issue:
Ubuntu 22.04 ships with a new version of ssh (OpenSSH8.9p1), while the previous ubuntu versions used OpenSSH8.4p1 or older.
There is a breaking change in OpenSSH8.8p1 which disables RSA signatures using SHA-1 Hash algorithm by default.
From OpenSSH Release Notes