can't figure out ssh, read lots of docs...

Giorgos Keramidas keramida at
Wed Jun 1 23:54:03 GMT 2005

On 2005-06-01 17:57, Steven Friedrich <FreeBSD at> wrote:
> Thanks to Nathan Kinkade, Roland Smith, Greg Barniskis, and Rick Preston for
> the replies.  Each gave me quite a bit of info and I'm still digesting it.
> I've been successful using ssh-agent, though I have to enter the passphrase
> each time I run my script.  That's really only an annoyance now because I'm
> developing the script and have to enter it often. That goes away when the
> script is stable.

Save the output of ssh-agent's invocation somewhere, say in ~/.ssh/rc.agent:

	$ ssh-agent > .ssh/rc.agent
	$ . .ssh/rc.agent

Then, use ssh-add to load the keys to the background agent:

	$ ssh-add .ssh/id_dsa

Other shells, even ones that are started from different sessions, much
later, can source the ~/.ssh/rc.agent script and use the already loaded
keys.  Make sure you don't leave an ssh-agent running and leave for
vacations or something though, because that defeats the entire non-empty
password thing :-)

More information about the freebsd-questions mailing list