由于客户端已经是 sshd,它无法打开与身份验证代理的连接,在这种情况下 ssh-add 的最佳方法是什么?
IE
ssh [email protected]
ssh-add
>> Could not open a connection to your authentication agent.
答案1
假设您已设置代理转发,并且代理已在本地系统上运行,则您只需打开一个新终端并ssh-add
在其中运行即可。代理进程保持不变,因此现有的代理转发应该能够使用新添加的密钥:
# on server
$ git pull
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
# in new terminal
~ ssh-add
Identity added: /home/muru/.ssh/id_rsa (/home/muru/.ssh/id_rsa)
Identity added: /home/muru/.ssh/id_ed25519 ([email protected])
# back to the server tab
$ git pull
Already up-to-date.