Le 28/03/2026 à 15:25, Tom via Dng a écrit :
> I'm trying to learn how to use ssh-agent. I followed the instructions
> at https://www.ssh.com/academy/ssh/agent.
>
> I have a remote machine that I login to over ssh from my desktop and
> want to run ssh-agent on this remote machine for further connections
> to other machines in a remote network.
>
> If I login once to the remote machine and run "eval $(ssh-agent)" then
> I can see SSH_AGENT_PID in the environment. If I login again from my
> desktop to the remote machine with a second ssh session, I can't see
> SSH_AGENT_PID in the environment. If I run "eval ${ssh-agent}" again,
> it starts up a second ssh-agent process.
>
> Is it possible to have only one ssh-agent process running for my user
> account and access it from multiple logins?
I sort of remember that one of the common methods is to have all
processes which need it, in particular terminal emulators, be
descendants of the ssh-agent process, which provides them with the
necessary env variables. If you are using a desktop environment,
ssh-agent should be started automatically if it is installed, so that
you don't need at all to start another instance by hand, or in your
profile. On my Xfce session, it is one of the first processes, although
not being listed in the applications to launch at startup. Try "ps ux"
to see that.
-- Didier