git配置ssh公钥

参考
在项目开发中,一个公共服务器有多个人在使用,git也是,我配置的默认的id_rsa.pub,但是不生效
提示

Permission denied (baas,keyboard-interactive,publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

然后我就想生成一个我自己的id_rsa文件,不用覆盖别人之前生成的

-f 选项指定生成文件的文件名
ssh-keygen -t rsa  -C "v_duanjiawei@baidu.com" -f duanjiawei

生成如下2个文件
duanjiawei  duanjiawei.pub

duanjiawei.pub就是我们要复制的公钥,但是复制之后还是不ok,

ssh-add  duanjiawei.pub

如果这里报错:Could not open a connection to your authentication agent.

执行: eval `ssh-agent`  之后再
ssh-add  duanjiawei.pub
原文地址:https://www.cnblogs.com/djwhome/p/12738446.html