Wednesday, July 1, 2009

TortoiseCVS over SSH

It is fairly easy to configure TortoiseCVS working in SSH mode, choose :ext: option instead of :pserver: option in Protocol section. But to avoid type the SSH password repeatedly, we better to create the public/private key pairs for TortoiseCVS. It comes down to 3 steps:

Step 1

Use PuTTYgen application to generate public and private key, just keep all settings as default, i.e., SSH-2 RSA, 1024 bits key. After clicking "Generate" button, you shall be able to save your public key and private key. Please save your private key to a secure place, well we need to adjust the public key a little bit, original public key file looks as below

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20090702"
AAAAB3NzaC1yc2EAAAABJQAAAIEAgvAZDLz116oJ7kHEMTUpCuRuCcBPvlUnTw4hGbjINXOvMDe3VYY0YeU6pR00oEsj9JzpZw/1Sa1H3nI2XB+e0wwv2m54NllhEb1U/c7kzfW5ODU1jEdrJonf1eXGhi8nc9NnBYf6pkpUNH7mg+sIaV+Fr+uVnqFzC4mHsZqEscc=
---- END SSH2 PUBLIC KEY ----

Please change it to

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAgvAZDLz116oJ7kHEMTUpCuRuCcBPvlUnTw4hGbjINXOvMDe3VYY0YeU6pR00oEsj9JzpZw/1Sa1H3nI2XB+e0wwv2m54NllhEb1U/c7kzfW5ODU1jEdrJonf1eXGhi8nc9NnBYf6pkpUNH7mg+sIaV+Fr+uVnqFzC4mHsZqEscc=

Note: make sure all characters are in single line.

Step 2
Upload public key file to CVS server, in my case, I uploaded it to $home/.ssh, and append to the existing authorized_key with following command in my server machine:
cat public.ppk >> authorized_keys

Note
: please change mode of .ssh folder to 700 and mode of authorized_keys to 600 otherwise you get "server refused our key" error upon login

Step 3
Ok, now you have a valid private key and public key set up, please test it with plink, make sure you load the correct private key file via Pageant, then issuing the command in my client machine
plink cvs_server_address

The server shall prompt you for input the username, after that, it shall log you in automatically without asking for a password. Otherwise you shall check above steps.

There is one guideline from TortoiseCVS

No comments:

Post a Comment