The following steps will show you how to setup SSH using public/private keys to authenticate yourself. (i.e. you will not need to type in a password to login)
ssh-keygen2.exe
It will
churn a little bit and then ask you where to save the keypair files.
I saved mine into C:\cvs_ssh\, you can save it anywhere
you want, the location of the key is not important.
When ssh-keygen2.exe asks you for a passphrase, just hit Enter. We want to create a key with a blank passphprase.
The created keyfiles should be named something like id_dsa_.... Open up the keyfile ending in .pub. It should look something like the following:
---- BEGIN SSH2 PUBLIC KEY ---- Subject: user@host Comment: "1024-bit dsa, user@host, Thu Nov 13 2003 00:00:00" AAAAB3NzaC1kc3MAAACBALpvwzNhcyYzweblbzsVB9i6BazkHRPdbWmrH1N/cpagepmhif [...approx 5-6 more lines of alphanumeric chars...] 8noiXlzhsx0tzrP+uQ== ---- END SSH2 PUBLIC KEY ----
Strip out the first 3 lines and the last line (i.e. lines beginning with "----", the Subject: line, and the Comment: line).
You should only be left with a few lines of jumbled alphanumeric chars. At the beginning of the very first line, add the text "ssh-dss" and then delete all linebreaks from the file so that it's one very long line.
ssh-dss AAAAB3NzaC1k [...very long line...] 8noiXlzhsx0tzrP+uQ==
Now, do a Save As... and save the newly formatted file so as not to overwrite the original. This new file will be the public key you will upload to the linux CVS server.
ssh-keygen -C user@myhost
and save your keypair into ~/.ssh/
When ssh-keygen asks you for a passphrase, just hit Enter becuase you want to create a key with a blank passphprase.
No additional formatting of the generated keyfiles is required.
Log in to your CVS/SSH server and find out what user account owns CVSROOT. (For me, on FreeBSD, it's the 'cvs' user).
Go into the CVSROOT owner's ~/.ssh/authorized_keys file (you will probably have to create the directory and file) and paste the public key data from from the keyfiles you generated above in the previous step. (If you're using windows, paste in the modified public keyfile).
Placing your public key into the cvs owner's ~/.ssh/authorized_keys tells the server that any user posessing the private component of the publickey is allowed to log in as the cvs user without a password (since we created the keyfile without a password).
ssh cvs@myserver.com
It should log you directly in without prompting for a password.
ssh -i /dir/to/key -l cvs myserver.com
export CVS_RSH="ssh"
export CVSROOT=":ext:cvs@cvsserver.com:/path/to/cvsroot"
# The following lines are NOT NECESSARY, but you might find them useful
# Show new files in current project
alias cvsnew="cvs status | grep ?"
# Show status of all *not* Up-to-date files
alias cvsstatus="cvs status | grep Status | grep -v Up"
# Update the current project
alias cvsupdate="cvs update -P -C -d"
To test, try and check something out
cvs -d $CVSROOT checkout someproject
Once you've got a command-line SSH client installed, load WinCVS.
Click "Admin"->"Preferences".
In the "General" tab, type in your CVS server details.
Select "Authentication: SSH" and click "Settings".
Un-click "RSA Private key".
Un-click "Additional SSH options"
For "SSH Client", point it to your ssh client (plink.exe in my case)
C:\plink.exe -i C:\cvs_ssh\key.PPK
Click OK to everything.
You can (and should) disable the CVS pserver in inetd.conf, since you will be running the cvs client (on the server) over the SSH tunnel, you do not need to have the pserver listening.