Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a SVN checkout using a Public/Private key pair?

Tags:

ssh

key

svn

I have to check some code and run it. I have the URL:

svn+ssh://[email protected]/home/svn/project/trunk 

I have a file with their private key. What do I do to get this code?

like image 665
Sam McAfee Avatar asked Oct 10 '08 16:10

Sam McAfee


People also ask

How do I checkout a SVN repository?

Check out files from Subversion repositoryIn the Get from Version Control dialog, click Add Repository Location and specify the repository URL. Click Check Out. In the dialog that opens, specify the destination directory where the local copy of the repository files will be created, and click OK.

How do I generate a public key from a private key?

You cannot generate private key from public key but you can generate public key from the private key using puttygen. As @alfasin mentioned if you could generate the private key from public key then RSA would be useless and this would make you vulnerable to attack.

How do you SVN checkout a folder?

Open the Repository Browser: Right-Mouse Button (RMB) on the newly created folder ==> TortoiseSVN ==> Repo-browser (or immediately Update to revision on a subfolder). Navigate to the folder you want to checkout completely. Press RMB on that subfolder, and select 'Update item to revision'. Press OK.


2 Answers

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/

like image 200
David Avatar answered Sep 18 '22 15:09

David


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.

like image 42
Zied Avatar answered Sep 18 '22 15:09

Zied