Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • This does not seem to be the issue in this particular question though. Here, the ssh-add command can't communicate with the SSH agent. In your case, the ssh-add command could not read your key (possibly due to a permission or ownership issue; you may have used sudo to generate the key or to create the ~/.ssh directory).
    – Kusalananda
    Commented Dec 29, 2022 at 10:18
  • The author stated that "ssh-add alone is not working: Error connecting to agent: No such file or directory", which is a vague question by itself and can be a variety of things and which is also what I experienced. I do not understand how this is a different topic. @Kusalananda Commented Feb 2, 2023 at 12:19
  • The error message that is given in the question is exactly what the SSH client says when it can not find the socket file which the $SSH_AUTH_SOCK environment variable points to. If the variable is unset (if you never started the agent), ssh-add says Could not open a connection to your authentication agent.
    – Kusalananda
    Commented Feb 2, 2023 at 12:23