Notation:
[s] - server side where SSH and CVS demons running
[c] - client side to access CVS through SSH
1. Generate SSH authentication key
[c] ssh-genkey -t rsa
Follow the prompt steps, it will create private key id_rsa and publice key id_rsa.pub under ~/.ssh. It is a good practice to have passphrase for the key.
* Windows users can get ssh from www.ssh.com.
2. SSH key-based Authentication
Copy id_rsa.pub to server.
[s] modify /etc/ssh/sshd_config as necessary. Take a note on AuthorizedKeysFile and AllowUsers lines. For example:
AuthorizedKeysFile authorized_keys2
AllowUsers tom@x.x.x.x;jerry
[s] cat id_rsa.pub >> authorized_keys2
[s] /etc/init.d/sshd restart
Now you should be able to ssh login from client to server without any passport prompt.
3. Config CVS SSH access
[c] cat ~/.bashrc, and add lines as below:
CVSROOT=:ext:login@remote_cvs_server:/usr/local/cvsroot
CVS_RSH=ssh
export CVSROOT
export CVS_RSH
* Windows users can setup them in Control Panel -> System -> Advanced -> Environment Variables.
4. Access CVS using SSH
cvs -d :ext:login@remote_cvs_server:/usr/local/cvsroot
* Windows users can download cvs from www.cvshome.org or http://www.wincvs.org/.
5. Eclipse CVS Perspective
Please refer to Eclipse CVS help. When you open a new project from CVS, following the steps in CVS Wizard, and select extssh as connection type. The CVS within Eclipse works in a very logical and much nicer way than cvs command line.
Comments
Post a Comment