SSH: Could not open a connection to your authentication agent


I accessed my server with ssh one time on from Ubuntu16.04

But when tried to connect next time I goy this error “Could not open a connection to your authentication agent” after executing $ eval ssh-agent -s $ ssh-add <path_to_private_key>

So I cant connect with ssh, and I don’t have login or password. How can I get at least a login and password to access the server?

Please, help :) I am new to Ubuntu


Can you share a little more information so we can best help you.

  • What operating system are you using on your local computer?
  • What SSH client are you using
  • If you’re using a command line SSH client what exact command are you using to attempt your connection.
  • If you’re on macOS or Linux, what is the contents of your ~/.ssh directory?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I am having the same problem. I have tried exec ssh-agent -s. It does not work. I am using Putty on a Windows machine.

i have the same problem in the gitlab about the jobs can someone help me please!

Instead of eval ssh-agent -s you may need to use:

exec ssh-agent bash

How this step is performed will vary depending on the OS you are on. This page has some other options and more information.