ssh-agent 终止后 ssh 身份验证失败
ssh authentication fails after ssh-agent terminates
背景故事:目前 运行 Arch Linux 并尝试使用 SSH 密钥验证进入 Github。我安装了 openssh 7.1p1-1 以及 git 2.6.4-1.
问题:ssh-agent 终止后(系统重启或 shell 关闭),我在尝试连接到 git 时收到 "Permission Denied (publickey)" 消息:
ssh -vT git@github.com
关于为什么我的身份没有保留的任何想法?我是否必须向 ~/.ssh/config 或 /etc/ssh/ssh_config 文件添加任何特殊内容?
感谢您提供的任何帮助。
在 ssh-agent
消失后,ssh
不再知道 id_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
背景故事:目前 运行 Arch Linux 并尝试使用 SSH 密钥验证进入 Github。我安装了 openssh 7.1p1-1 以及 git 2.6.4-1.
问题:ssh-agent 终止后(系统重启或 shell 关闭),我在尝试连接到 git 时收到 "Permission Denied (publickey)" 消息:
ssh -vT git@github.com
关于为什么我的身份没有保留的任何想法?我是否必须向 ~/.ssh/config 或 /etc/ssh/ssh_config 文件添加任何特殊内容?
感谢您提供的任何帮助。
在 ssh-agent
消失后,ssh
不再知道 id_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