:: Re: [DNG] Using ssh-agent in multip…
Top Page
Delete this message
Reply to this message
Author: Bob Proulx
Date:  
To: dng
Subject: Re: [DNG] Using ssh-agent in multiple logins
Lars Noodén via Dng wrote:
> Tom via Dng wrote:
> > Is it possible to have only one ssh-agent process running for my user
> > account and access it from multiple logins?
>
> What problem are you trying to solve?
>
> If you are passing through one or more bastions/jumphosts then you should
> probably use -J for ProxyJump instead.


This is the best answer. Jump through the bastion host. Then you can
use the ssh-agent on your desktop.

> Is it possible to have only one ssh-agent process running for my user
> account and access it from multiple logins?


Answering this directly though is the "keychain" package. Install it.
Then put this in your .bash_profile or .xsessionrc or the other
appropriate environment file.

    keychain -q
    . $HOME/.keychain/$(hostname)-sh


That will do all of the bookkeeping to start an ssh-agent if it is not
running or to share an ssh-agent that is running.

Hint: This also works to allow cronjobs to have access to a shared
ssh-agent.

Bob