Hi Predrag,

I am not sure that I am getting your question right, but for starting ssh
agent on my lap, I simply uncomment (or create?) the following in my
.xinitrc
...
if [ "$SSH_AGENT_PID" ]; then
 ssh-add -D < /dev/null
 eval `ssh-agent -s -k`
fi
...

For starting (and keeping alive) a ssh agent on a remote host I use
http://www.funtoo.org/Keychain

If the keys of the remote host are password protected, the password needs
to be typed in upon any (re)start of the remote host.

I hope I was on topic.

Regards,

On Fri, Oct 7, 2016 at 10:38 PM, Predrag Punosevac <punoseva...@gmail.com>
wrote:

> Hi Misc,
>
> This is a rather trivial question. What is the recommended way of
> starting ssh-agent when upon ssh login into the remote host. Namely I
> have a remote host which is used as a gateway to a bunch of machines
> whose ssh keys are password protected. I have
>
> AddKeysToAgent yes
>
> in my ~/.ssh/config file as well as
>
> xidle -program "/usr/bin/ssh-add -D" -timeout 300  &
>
> in my .xsession file. Everything works nice and neat when I am on my
> desktop but I want to replicate functionality when I ssh to a headless
> (no X) shell gateway.
>
> Thanks,
> Predrag

Reply via email to