Personal tools
You are here: Home / cm / Wiki / Setting Up for CMISS CVS Access
Navigation
Log in


Forgot your password?
 

Setting Up for CMISS CVS Access

The CMISS CVS repository is on 'cvs.bioeng.auckland.ac.nz' and so this is the CVS server machine.

You need to be a member of the 'cmiss' group as indicated by the Institute's LDAP server in order to access the repository. (You can check this with the 'groups' command on cvs.bioeng.auckland.ac.nz.)

It is convenient to set up a nickname for the CVS server so that the configuration can be changed easily should be server move or the access method change.

Edit the file '~/.ssh/config' so that it contains the following:

Host cmiss-cvs
  # Use this line if this machine is inside the University
  # or has vpn access to the University:
  Hostname cvs.bioeng.auckland.ac.nz
  # Comment out the above line and uncomment these lines when using port
  # forwarding to access cvs.bioeng.auckland.ac.nz from outside the University:
#   Hostname localhost
#   Port 8888
#   HostKeyAlias cvs.bioeng.auckland.ac.nz
  # Edit and uncomment this if your login name for machines in the institute
  # differs from that for this machine:
#   User user001

To tell cvs the location of the repository when checking out files, the option '-d cmiss-cvs:/cvs/cmiss' can be used when invoking cvs to check out files. If you only use one repository, then it is often more convenient to instead set the environment variable 'CVSROOT' to 'cmiss-cvs:/cvs/cmiss'. (More information is available in the node "Specifying a repository" in the "Cederqvist manual":http://ximbiot.com/cvs/manual/ also available via 'info cvs'. On Linux, 'man 7 environ' provides more information on environment variables.)

Access to the CVS server machine is through ssh and so the environment variable 'CVS_RSH' must be set to 'ssh' to inform cvs to use this command (unless cvs was configured to use ssh by default).

('fsh' may be used instead of ssh if it is available on the client machine and 'in.fshd' is one of the directories in the environment variable 'PATH' on cvs.bioeng.auckland.ac.nz.)

From a tcsh (see output from 'echo $0'), for example:

setenv CVSROOT cmiss-cvs:/cvs/cmiss
setenv CVS_RSH ssh

or from bash, ksh, or zsh:

export CVSROOT=cmiss-cvs:/cvs/cmiss
export CVS_RSH=ssh

You may want to do this in your shell startup file.

The CMISS CVS server machine is only directly accessible from inside the University of Auckland. If you are inside the University or have VPN access then you are ready to start using cvs commands; otherwise see section "Outside Access" below.

When running cvs commands, a connection with the CVS server machine will be established through ssh and authentication is through the Institute's Kerberos server so you may be prompted for your password on the Kerberos server.

The "A Day With CVS":http://cvsbook.red-bean.com/cvsbook.html#A%20Day%20With%20CVS section from "Open Source Development with CVS" covers most CVS commands in a step-wise manner.

How to avoid typing your password all the time

As ssh is being used for cvs access, every time you issue a cvs command and will subsequently be asked for a password. After a while this becomes rather cumbersome. Fortunately it is possible to avoid this annoyance by generating a public/private key pair on your local machine. You can then place your public key on machines you wish to access via ssh without using a password.

On your local machine do the following:

cd ~/.ssh
ssh-keygen -t rsa

You can hit enter at each of the prompts and this will create a public and private key pair. id_rsa.pub will contain your public key which is a big long string.

Now ssh onto the server you want to access (eg bioeng10). Change into the .ssh directory. You want to add your public key into the authorized_keys file. If there is no authorized_keys file in your ~/.ssh directory you can simply create one. Once you have added your public key into this file and saved it you should be able to ssh to that server without being asked for a password.

Outside Access via Port Forwarding

You can access the CMISS CVS server (or any machine inside the University)

from outside the University by using another ssh connection to forward a local port through a visible gateway machine to the ssh port on the CMISS CVS server (or other machine). bioeng10 is a suitable gateway machine.

To do this, edit the cmiss-cvs section that you added to '~/.ssh/config' as indicated in its comments for port forwarding and add the following section:

Host bioeng-tunnel
  Hostname bioeng10.bioeng.auckland.ac.nz
  LocalForward 8888 cvs.bioeng.auckland.ac.nz:22
  # Edit and uncomment if required:
  # User user001

You should end up with something like:

Host cmiss-cvs
   Hostname localhost
   Port 8888
   HostKeyAlias cvs.bioeng.auckland.ac.nz
  # Edit and uncomment this if your login name for machines in the institute
  # differs from that for this machine:
  # User user001

Host bioeng-tunnel
  Hostname bioeng10.bioeng.auckland.ac.nz
  LocalForward 8888 cvs.bioeng.auckland.ac.nz:22
  # Edit and uncomment if required:
  # User user001

The nickname 'bioeng-tunnel' refers to an ssh connection that forwards the necessary ports. (8888 is chosen at random. You could try any port number over 1024 provided the same port is used in the cmiss-cvs config.) This must be started before and running while any cvs commands are issued.

Start the tunnel with:

ssh -N bioeng-tunnel

You may wish to add the '-f' option to background the tunnel process after login, or use ^Z and 'bg', or remove the '-N' option to have a shell on bioeng10 in the foreground and issue local commands from another terminal. (You can bundle the ssh options with version 3.1p1 or later.)

While this connection is active you can access the CVS server machine, and in fact anyone on your machine can use your tunnel to access sshd on the server.

You are now ready to use cvs in (almost) the same way as if you were inside the University.