简体   繁体   中英

How do I SVN checkout using a Private key authentication?

I have to check out some code and run it in my eclipse. I am working on Windows. I have the URL:

svn+ssh://somename1@subversion.host.com/GoogleCloud/10.0.0

Below is my screenshot of my eclipse in which I am trying to use private key authentication

在此输入图像描述

But somehow I am not sure what key I am supposed to generate and how to generate that as well? And after generating where should I put that file?

Can anyone give me detailed walk through on this of how can I do this? Thanks

You need to generate a key pair for SSH and then add the public key to the account you are trying to log in to.

Generate key pair

To generate a key pair on Windows (assuming from your screenshots) you can download puttygen.exe from the PuTTY website

Run puttygen.exe , at the bottom you will see a frame called Parameters and SSH-2 RSA selected by default (If the selected value isn't SSH-2 RSA or SSH-2 DSA , select one of those). There should also be a Number of bits in a generated key parameter. Change the value to be at least 2048 (the default as of writing is 1024).

Once those values are set correctly click the Generate button. Puttygen will direct you to move the mouse over the blank area. It uses these mouse movements to seed a random generator. Move the mouse around until the progress bar fills completely.

Add public key to target account

Once the key pair has been generated a text field labeled Public key for pasting into OpenSSH authorized_keys file: will appear. This window contains the PUBLIC KEY that you need to append to your ~/.ssh/authorized_keys file on the target machine. The entire key is one line of text and should be appended as such.

Next you will need to save the PRIVATE KEY to your local machine. You do this by first entering a passphrase and confirming it in the text fields labeled Key passphrase and Confirm passphrase then click Save private key . Save the file somewhere you'll remember in your filesystem.

SECURITY NOTE: The file you just saved is a PRIVATE KEY and should be handled carefully. If the private key is ever exposed an attacker could use it to login as you. If you ever feel that your private key has been compromised you should delete the corresponding PUBLIC KEY from the ~/.ssh/authorized_keys file where the key is used and generate a new key pair.

Using the private key to authenticate

Once you have done all of the above you'll be able to use the PRIVATE KEY you just saved to authenticate your svn+ssh session. Using the window from your screenshot, browes for the key file and enter the passphrase you set on it. Confirm that the SSH port number is correct (22 is the default port) and then click OK . You should now be logged in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM