In the CVS mostly used command examples, how to create a local repository were described, here just for remote repository access, which commonly being used in working environment.

Using ssh as the communication medium for cvs provides security advantages over using pserver and/or rsh. Here's a quick example on how to use this mechanism.

If:

  • your username is Jhon
  • the existing cvs repository is at /home/Jhon/CVSROOT/
  • the project name is my_project

Then on the remote machine,

  1. Set the environment variabe CVS_RSH to ssh (make sure ssh is in your path. You may wish to do this in your login scripts):
    sh/bash
    CVS_RSH="ssh"; export CVS_RSH
    csh
    setenv CVS_RSH "ssh"
  2. Use :ext:This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/Jhon/CVSROOT as the repository location for all cvs commands. This can be done by:
    • Set the environment variable CVSROOT or
    • Use the global option -d.

Example:

To checkout the project my_project, type

cvs -d :ext:This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/Jhon/CVSROOT checkout my_project.

Or

if you have environment variable

CVS_RSH=ssh
export CVSROOT=:ext:This email address is being protected from spambots. You need JavaScript enabled to view it.:/home/Jhon/CVSROOT

run

cvs checkout my_project

You will be prompted for joe's password. To avoid being prompted for the password with each CVS command, you may wish to use ssh-agent.