Keep ssh-agent running on remote machine

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
What is the canonical way to keep a ssh-agent running on a remote
machine?   This agent has to be given a passphrase to be started.

I want to run rsnapshot backups across two remote machines.  The one
running rsnapshot will need the agent running to avoid needing manual
intervention for passwd.

Of course starting the agent needs a passphrase too so how to automate

Re: Keep ssh-agent running on remote machine

Quoted text here. Click to load it

I don't think you can load a passphrase protected identity automatically.
The first time I need the agent I load it manually (or at boot time), and
save the outputted enviroment settings to a shell script. I then source
the shell script and manually add the identity to it - once. Until the
machine reboots that agent will retain the identity and all you need to do
is source the shell script to access it.

Be careful to protect this shellscript from unauthroized users. If they
can source it, they can authenticate as whatever identity is cached by the

There's also a shell script named "keychain" (you should be able to google
it) that automates all this.


Site Timeline