gpt4 book ai didi

bash - SSH 代理 : Could not open a connection to your authentication agent

转载 作者:行者123 更新时间:2023-11-29 09:42:10 32 4
gpt4 key购买 nike

我已经做了很多研究,但没有一个奏效。这是我终端的输出:

$ ps aux | grep ssh-agent
tsiruan 4080 0.0 0.0 13468 388 ? Ss 11:47 0:00 ssh-agent
$ env | grep SSH
SSH_AUTH_SOCK=/tmp/ssh-8CJH68abyLAa/agent.4079
SSH_AGENT_PID=4080
$ sudo ssh-add .ssh/bitbucket_ssh
[sudo] password for tsiruan:
Could not open a connection to your authentication agent.

我已经尝试过 $ eval $(ssh-agent) 使用反引号、单引号、双引号、带和不带括号、带和不带 -s 选项,甚至还有一些答案,例如:

$ exec ssh-agent bash

请帮助我,我正在 arch linux 上运行 bash。

最佳答案

首选:不要使用 sudo

ssh-add .ssh/bitbucket_ssh

第二种选择:显式传递环境变量

假设您的 bitbucket_ssh 文件只能由 root 读取——更合适的方法是修复权限,但作为一种临时方法,您可以通过以下方式传递 SSH_AUTH_SOCK:

sudo env SSH_AUTH_SOCK="$SSH_AUTH_SOCK" ssh-add .ssh/bitbucket_ssh

关于bash - SSH 代理 : Could not open a connection to your authentication agent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48017345/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com