SSH [SOLVED]: ssh-agent: Could not open a connection to your authentication agent

SSH [SOLVED]: ssh-agent: Could not open a connection to your authentication agent

Home Forums SSH SSH [SOLVED]: ssh-agent: Could not open a connection to your authentication agent

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36907

    Anonymous

    QuestionQuestion

    I have done a ton of research already, but none of those works.
    This is output from my terminal:

    $ 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.
    

    I have tried $ eval $(ssh-agent) with backticks, single quote, double quote, with and without parentheses, with and without -s option, and even some answers like:

    $ exec ssh-agent bash
    

    please help me , I am running bash on arch linux.

    #36908

    Anonymous

    Accepted AnswerAnswer

    First Choice: Don’t Use sudo

    ssh-add .ssh/bitbucket_ssh
    

    Second Choice: Pass The Environment Variable Explicitly

    Assuming your bitbucket_ssh file is only readable by root — the more appropriate approach is to fix the permissions, but as an interim approach, you can pass SSH_AUTH_SOCK through:

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

    Source: https://stackoverflow.com/questions/48017345/ssh-agent-could-not-open-a-connection-to-your-authentication-agent
    Author: Charles Duffy
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.