Results 1 to 4 of 4

Thread: SSH ssh-add: Could not open a connection to your authentication agent.

  1. #1
    Join Date
    Mar 2011
    Beans
    5

    Question SSH ssh-add: Could not open a connection to your authentication agent.

    As the title says, whenever I try to use the ssh-add command I always get the same error. (exact console copies for your convenience)

    ty@ubuntu:~$ sudo ssh-add
    [sudo] password for ty:
    Could not open a connection to your authentication agent.
    ty@ubuntu:~$
    After looking pretty much everywhere on the internet, I found a lot of people had the same problem, but their solutions didn't work for me.
    ty@ubuntu:~$ exec ssh-agent bash
    ty@ubuntu:~$ sudo ssh-add
    Could not open a connection to your authentication agent.
    Am I missing something basic?
    Last edited by seth1010; March 9th, 2011 at 04:50 AM.

  2. #2
    Join Date
    Mar 2011
    Beans
    5

    Re: SSH ssh-add: Could not open a connection to your authentication agent.

    Alright, I figured out my problem, but in order to keep from being one of *those* guys, I figured that I will let anyone that is having similar problems how to fix it.

    What I should have noticed is that I needed to use sudo in order to ssh-add. This is a big red flag. What happened in my case was I had given root ownership of the .ssh folder. From what I can figure, I did this by opening gedit with sudo while trying to open a file in that directory. More info here.

    What I did to solve the problem was delete the .ssh folder entirely and start again. There is probably a much more elegant way to do this, but being a linux newbie, this worked just fine.

    Comments from more experienced members would be amazing, I'm still trying to wrap my head around this.

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: SSH ssh-add: Could not open a connection to your authentication agent.

    Personally, I would have just changed ownership and permission on the ~/.ssh driectory, you could have done it using the following commands:

    Code:
    sudo chown -R user:user ~/.shh
    where user:user = your user name and group name, then set the directory permission to 700:

    Code:
    chown 700 ~/.ssh
    then cd in to the directory and give the correct file permissions to the files inside:

    Code:
    cd .ssh
    and

    Code:
    chmod 600 *

  4. #4
    Join Date
    Dec 2010
    Beans
    3

    Re: SSH ssh-add: Could not open a connection to your authentication agent.

    cariboo, I think you meant
    Code:
    $ chmod 700 ~/.ssh

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •