前兩天重裝了系統(tǒng)统屈,今天要使用 Git 胚吁, 于是下載了最新版本的GIT,并使用了 ssh-keygen -t rsa -C
配置新的公鑰匙愁憔,但是連接的時(shí)候腕扶,出現(xiàn)了 Permission denied (publickey)
git clone ssh://git@xx:10022/n/story.git
Cloning into 'story'...
git@xx: Permission denied (publickey).
fatal: Could not read from remote repository.
對比了一下,發(fā)現(xiàn)沒有key是沒有問題的吨掌。于是查來查去半抱,發(fā)現(xiàn) 2021年09月26日發(fā)布的 OpenSSH 中移除了對RSA-SHA1的支持。
所以我下載新版本的GIT并不支持 RSA膜宋,換成 ed25519
的加密方式窿侈,重新配置公鑰,問題解決秋茫!
ssh-keygen -t ed25519 -C "email"
linux 服務(wù)器上史简,不想改密鑰的情況下,也可以增加config文件 ~/.ssh/config
肛著,讓 openssh 支持 rsa
在 ~/.ssh/config 加上如下配置
Host gitee.com
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa