一、前言:
windows電腦重裝系統(tǒng),去官網(wǎng)下載了最新的git安裝,一路next下來,打開bash按老路子設(shè)置,生成公鑰
git config --global user.name "yourname"
git config --global user.email "your@email.com"
ssh-keygen -t rsa -C "your@email.com"
把公鑰添加到阿里云,clone代碼時(shí)拉不下來,報(bào)錯(cuò)。
Unable to negotiate with **** 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.
查看自己是開發(fā)者權(quán)限,重置一遍公鑰再添加也不行,去網(wǎng)上找方法,介紹這種情況的原因就是新的ssh客戶端不支持ssh-rsa算法,要修改本地配置重新使用ssh-rsa算法。
圖片.png
二、解決:
具體做法:到當(dāng)前用戶目錄下的.ssh文件中創(chuàng)建config文件(config沒有后綴),使用記事本打開添加如下文章來源:http://www.zghlxwxcb.cn/news/detail-669858.html
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
?文章來源地址http://www.zghlxwxcb.cn/news/detail-669858.html
到了這里,關(guān)于記一次使用git報(bào)錯(cuò),解決Unable to negotiate with **** port 22: no matching host key type found. Their offer:...的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!