Github加入ssh公钥还是登录不了

使用  ssh-keygen -t rsa -b 4096 -C "your_email@example.com" 生成密钥对 testkey  testkey.pub后,将 testkey.pub 加入github账户,git clone时依然出现 permission denied的错误;

解决办法:

在 /usr/local/etc/ssh_config 中加入密钥信息

Host github.com
    HostName github.com
    IdentityFile ~/.ssh/testkey.pub

使用 命令 测试连接情况 

     ssh -vT git@github.com

posted @ 2025-03-19 11:19  迷途小菜鸟  阅读(14)  评论(0)    收藏  举报