文章目录
Mac 更新版本出现 git 报 Permission denied (publickey).
更新系统版本后
pull 代码
Update failed
XXXXXXX: Permission denied (publickey).
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
一、问题出现原因
查询资料得知任何运行OpenSSH 8.8 或更新版本的系统默认使用 SHA-1 哈希算法禁用 RSA 签名。之前的命令,不再适用,算法导致旧的RSA签名无效。
二、解决步骤
1.删除.ssh文件夹重新生成
使用ed25519的算法生成密钥,之后再直接复制密钥去对应的机器。
代码如下:
ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/nathan15/.ssh/id_ed25519):
Created directory