tags:

views:

455

answers:

3

I know the answer is out there, but I'm pretty Unix-dumb and probably wouldn't recognize the solution if it hit me in the face.

I'm on a Mac, connecting to a SVN server via SSH tunneling. I have to ssh-add privateKey.txt every time I want to connect to the SVN server (Both Cornerstone and Xcode are connecting to SVN).

Is there a way to "save" the key somewhere so I don't have to do this every time? Add it to my Keychain? Some config file? Start up script?

+2  A: 

I don't have much experience with macs, so not sure if this version is ok for your, but have a look at http://www.phil.uu.nl/~xges/ssh/

If this particular app doesn't work, that's what you're looking for anyways - ssh agent. On unix-like boxes, you'd want to start your whole window manager through that, to get the global effect, but it might not be possible in osx.

Some more info: http://www-uxsup.csx.cam.ac.uk/~aia21/osx/leopard-ssh.html

viraptor
A: 

First, move your private key file into ~/.ssh. This is not strictly necessary but it's the standard place for such things.

Then run ssh-add -K ~/.ssh/privateKey.txt. It'll prompt for your passphrase if necessary, then add it to your Keychain.

After that, you shouldn't have to do anything else. A slightly longer explanation is available here.

Nicholas Riley
+1  A: 

sshkeychain is one possibility. installs fine with macports using:

sudo port install sshkeychain

it uses the keychain to store passwords, and you may simply launch it at the start-up of your login session (using at the first launch the usual right-ght click in the dock's icon + "launch at startup")

Note that Apple's svn uses keychain to store passwords but not necessarily the svn binary you would build with macports.

meduz