git:could not open a connection to your authentication agent
git:could not open a connection to your authentication agent
错误:
vagrant@homestead:~/Code/sample$ git push -u origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
先执行 eval `ssh-agent`
再执行 ssh-add ~/.ssh/rsa
上面有可能会找不到路径
vagrant@homestead:~/Code/sample$ ssh-add ~/.ssh/id_key
/home/vagrant/.ssh/id_key: No such file or directory
切换到秘钥目录在执行就行了
vagrant@homestead:~$ cd .ssh/
vagrant@homestead:~/.ssh$ ssh-add ~/.ssh/id_rsa
成功:Identity added: /home/vagrant/.ssh/id_rsa (/home/vagrant/.ssh/id_rsa)
文章来源:刘俊涛的博客
欢迎关注,有问题一起学习欢迎留言、评论。
你要保守你心,胜过保守一切。
本文来自博客园,作者:刘俊涛的博客,转载请注明原文链接:https://www.cnblogs.com/lovebing/p/9528974.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步