I have to check some code and run it. I have the URL:
svn+ssh://myuser@www.myclient.com/home/svn/project/trunk
I have a file with their private key. What do I do to get this code?
I have to check some code and run it. I have the URL:
svn+ssh://myuser@www.myclient.com/home/svn/project/trunk
I have a file with their private key. What do I do to get this code?
The private key goes on the client machine, often named as ~/.ssh/id_rsa
, ~/.ssh/id_dsa
, or ~/.ssh/identity
depending on the SSH version and the type of key. However, you can just use ssh -i path/to/private.key
.
This is presuming that the corresponding public key exists on the server in ~/.ssh/authorized_keys
, and that your local machine is running the OpenSSH client. If you are using PuTTY on Windows, simply open up the Pageant program, and import the key via the GUI.
If you need to use a custom key just for svn, the following will work:
SVN_SSH="ssh -i /path/to/key_name"
export SVN_SSH
svn commands
http://labs.kortina.net/2010/01/30/svn-checkout-with-private-key-over-ssh/
Add this entry to your ~/.ssh/config file:
Host YOUR_SERVER
IdentityFile YOUR_PRIVATE_KEY_PATH # (ex: ~/.ssh/rsa)
User USER_NAME
For more options, see the ssh_config man page.
just use ssh-add command (it will ask your for your password, this is the password you used when you created this public private key pair ).
ssh-add PATH_TO_YOUR_PRIVATE_JEY
e.g. ssh-add ~/.ssh/myPrivateKey.key
verify that you added the key correctly by doing this
ssh-add -l
That will list all identity files it is using.
Here are the steps that I used to connect from the Mac OS X command line to my server via svn+ssh:
On server:
ssh-keygen -b 1024 -t dsa -f mykey (creates mykey and mkey.pub files)
Copy contents of mykey.pub to ~/.ssh/authorized_keys (create authorized_keys file if it doesn't exist)
Download mkey to your local machine and run:
chmod 600 mkey (the next step won't run otherwise)
svn-add mkey (enter your passphrase)
checkout from your svn server with ssh:
svn co svn+ssh://user@server.com/repos/path
Delete mkey and mkey.pub from your server
In addition to the answers two screen shots from Eclipse 3.7 with Subversive.
Enter the user name! (I have forgotten this before taking the screen shot). Do not enter a password.
Enter the key passphrase if you private key is passphrase protected.
A picture is worth a thousand words.
Add the private key to your ~/.ssh/
folder and then run ssh-agent $SHELL; ssh-add;
, and then the svn co
of that URL should work.