Wednesday, September 12, 2012

Multiple password prompt issue with Tortoise SVN

What we need to do is
  1. To generate a public-key/private-key pair on the SVN server.
  2. Add the public key to the server's list of authorized keys.
  3. Save the private key into a file on my computer.
  4. Use PuTTy-gen to make this private-key PuTTy compatible.
  5. Add this PuTTy-compatible private key to Pageant.
From now on, Tortoise SVN will use the key from Pageant's list of keys. As the corresponding public key is in the server's list of authorized keys, the client-resident-tortoise's signature can be verified by the server and thus I do not need to enter password again and again.

The procedure is as follows:
  1. Download PuTTy, PuTTy-gen, and Pageant.
  2. Log in to SVN server.
  3. Type "ssh-keygen -b 1024 -t dsa -f mykey"
  4. You will be asked to enter a pass-phrase for the key-pair. Do not forget it. You need it while making it PuTTy-compatible on your machine.
  5. If you type "ls" you will see "mykey" and "mykey.pub" inside the current directory.
  6. "mykey" is the private key and "mykey.pub" is the public key.
  7. Type "mkdir .ssh" to create a folder that will hold the list of authorized keys on the server.
  8. Type "cp mykey.pub .ssh/authorized_keys" to add the public key into the list of authorized keys.
  9. Type "cat mykey" to get the contents of the private key.
  10. Copy the output of the "cat mykey" command and save it in a file with .ppk extension on your machine.
  11. Now startup PuTTy-gen and load this .ppk file you have just saved on your machine and hit generate.
  12. PuTTy-gen will generate a private key file compatible with it.
  13. Hit "Save private key" and save this generated private key file in another .ppk file.
  14. Now startup Pageant.
  15. Hit add key, and choose this compatible .ppk file. 
  16. As long as pageant is running, the Tortoise SVN gets the key from it instead of asking you for password again and again.
  17. ONE LITTLE PROBLEM: if you exit Pageant, then when you start it again, its list of keys will be empty. So, you need to add the compatible private key and to add it to Pageant it will require you to enter the pass-phrase you used while generating the private-key/public-key pair. But this is much better to enter the pass-phrase once per session of Pageant that to enter password many many times within a single session.

No comments:

Post a Comment