eval $(ssh-agent) does not wake up any previous agent. It starts a brand new agent and configures your current shell to use this new one. Hence it always starts with no keys loaded.Then I close the SSH connection between the PC and the PI3, I open a new one, ssh-add -l again, but the PI3 ssh agent does not answer. So I enter "eval $(ssh-agent)" to wake it up, and then ssh-add -l again. And I see that the agent has no key, I have to add it again.
When you start an agent it prints some information that is crucial for connecting to it later:
Code:
pi@pj:~ $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-XMy2Z3qbfqVU/agent.98585; export SSH_AUTH_SOCK;SSH_AGENT_PID=98586; export SSH_AGENT_PID;echo Agent pid 98586;You could write the settings to a file before consuming them, so that you can later consume them again in other sessions:
Code:
sess1$ ssh-agent > ~/.agentsess1$ . ~/.agentAgent pid 98586sess2$ . ~/.agentAgent pid 98586Statistics: Posted by jojopi — Wed Feb 11, 2026 12:02 am