Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh代理终止后ssh身份验证失败_Ssh_Archlinux - Fatal编程技术网

ssh代理终止后ssh身份验证失败

ssh代理终止后ssh身份验证失败,ssh,archlinux,Ssh,Archlinux,Backstory:当前正在运行Arch Linux,并试图使用SSH密钥对Github进行身份验证。我已经安装了openssh 7.1p1-1以及git 2.6.4-1 问题:在ssh代理终止(系统重新启动或外壳关闭)后,我在尝试使用以下方式连接git时收到“权限被拒绝(公钥)”消息: ssh -vT git@github.com 关于为什么我的身份不存在有什么想法吗?我是否必须向~/.ssh/config或/etc/ssh/ssh\u config文件添加任何特殊内容 感谢您提供

Backstory:当前正在运行Arch Linux,并试图使用SSH密钥对Github进行身份验证。我已经安装了openssh 7.1p1-1以及git 2.6.4-1

问题:在ssh代理终止(系统重新启动或外壳关闭)后,我在尝试使用以下方式连接git时收到“权限被拒绝(公钥)”消息:

    ssh -vT git@github.com

关于为什么我的身份不存在有什么想法吗?我是否必须向~/.ssh/config或/etc/ssh/ssh\u config文件添加任何特殊内容


感谢您提供的任何帮助。

ssh-agent
消失后,
ssh
不再知道
id\u-github
存在,因此它从不尝试使用该密钥进行身份验证。如果要强制
ssh
始终为
github.com
使用该密钥,可以将其添加到
~/.ssh/config

Host github.com
    IdentityFile ~/.ssh/id_github
    User git # Handy addition so you can skip the username part in Github URLs

这里回答了我关于SSH密钥为什么不存在的问题。但在尝试从github克隆时,使用此解决方案似乎没有帮助。因此,经过更多的研究,我启用了一个密钥环,并向其中添加了我的id\u github ssh密钥。谢谢你的帮助!