You are not logged in.

#1 2024-02-20 11:06:40

tachtler
Member
Registered: 2020-08-23
Posts: 25

[solved] - Could not open a connection to your authentication agent.

Hi,

since the last reboot (and maybe update), I get the following error message when I try to use the ssh-agent as my user:

$ ssh-add -l
Could not open a connection to your authentication agent.

A call of ssh-agent results in the following output:

$ ssh-agent 
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXceDXBP/agent.3697; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3698; export SSH_AGENT_PID;
echo Agent pid 3698;

Listing /tmp

$ ls /tmp/ssh-XXXXXXMWd8bs/agent.3993 
/tmp/ssh-XXXXXXMWd8bs/agent.3993

I have noticed that after each call of ssh-agent a new directory in /tmp/ssh-XXXXX... is created.

Thanks in advance for any help!
Klaus.

Last edited by tachtler (2024-02-20 13:27:04)

Offline

#2 2024-02-20 11:19:10

astralc
Member
Registered: 2022-09-17
Posts: 94

Re: [solved] - Could not open a connection to your authentication agent.

you starting agent again? is it started before running ssh-add? - each call for ssh-agent start new agent, this is how it work.

read this on how to use ssh-agent: https://wiki.archlinux.org/title/SSH_keys#SSH_agents

Offline

#3 2024-02-20 11:21:35

tachtler
Member
Registered: 2020-08-23
Posts: 25

Re: [solved] - Could not open a connection to your authentication agent.

Hi,

thank you for your answer.

My problem is that it is only when I actually start the agent with eval $(ssh-agent) that I have access to it, no matter how many times I type ssh-agent.


Thanks and regards
Klaus.

Offline

#4 2024-02-20 11:28:25

astralc
Member
Registered: 2022-09-17
Posts: 94

Re: [solved] - Could not open a connection to your authentication agent.

If it is recent change with gnome, this thread may be related:
https://bbs.archlinux.org/viewtopic.php?id=293029

eval $(ssh-agent) only "valid" for current shell (as SSH_AUTH_SOCK env can only be set for current shel via this command). - in the wiki link there is how to use user systemd service for agent, it can be used in every app (without starting new agent for each one) this way.

Offline

#5 2024-02-20 13:26:16

tachtler
Member
Registered: 2020-08-23
Posts: 25

Re: [solved] - Could not open a connection to your authentication agent.

Hi,

thank you for the Link →

With GNOME installed → I've added to ~/.bashrc

export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh

Without GNOME installed → I've added to ~/.bashrc

export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket

and enabled the service

systemctl enable --user ssh-agent.service

Nothing more, that did the trick for me!

Thank you so much for your help!

Greetings
Klaus.

Last edited by tachtler (2024-02-22 06:34:43)

Offline

Board footer

Powered by FluxBB