Skip to Content

Remote Access to Repositories

Most of the examples in this section show “file” URLs, which means that you must be logged into the machine that the respository is stored on to access its contents.

Subversion also supports a number of remote-access methods. The most flexible methods require additional set up by systems staff, but have the advantage of not requiring everyone accessing your repository to have an account on the math servers. There is also an access method that allows you and your team to access the repositry from machines that aren't part of the math cluster (such as your personal machine) provided that you have a math cluster account.

Simple Access via SSH

The simple method uses SSH to allow you to connect to a math machine with access to the repository and use Subversion commands to manipulate the repository or update your working copy.

To use this method, you specify the Subversion repository as something like

svn co svn+ssh://host.math.hmc.edu/path/to/repository/project/trunk workdir

where host.math.hmc.edu is a math cluster host that you can log into via SSH; /path/to/repository is the path to your repository; project/trunk is the path within the repository to the trunk of your project called project; and workdir is your local working directory.

If your username on your local system isn't the same as your math-cluster username, you can specify a username with the --username username option to svn co or hit Return, which should prompt you for a username.

Note that this method is most suited for personal projects, such as a thesis or other research project where you're the only person using the repository. Shared projects, especially those with departmental sponsorship, should use the HTTP Method.

Configuration Files

Within your repository directory, there is a directory called conf that has several files for use with this access method. The authz file is used to specify which users have access to what parts of the repository (i.e., you can make parts of the repository readable by some users, but not writable by all of those users, restrict read access to only a few users, etc.). The passwd file lists the users and passwords.

The svnserve.conf file spells out which authz and passwd files to use, as well as some additional configuration options.

More details are available in the Subversion book (links on our resources page).

SVNServe Method

Works just like the svn+ssh method, but runs as a server and talks over a TCP/IP port. Our account policy forbids ordinary users from running servers, so if you need access for outside users, you must discuss it with the department's systems staff first (or run it on a personal machine).

HTTP Method

The most commonly seen public access method is the HTTP method, which takes advantage of tools and features provided by the Apache web-server program to serve out the contents of Subversion repositories.

Getting the HTTP access method set up is complex and, again, requires the systems staff to modify settings on the department's servers.

If you are trying to access an existing repository set up by the department, there are two possible methods.

If You Have a Math Account

If you have (or are eligible for) a math account, you can simply log into a machine, open a terminal, and run create-subversion-password. The script will prompt you for a password, then ask you again, check the second one against the first to make sure they're the same, then send an e-mail with an encrypted password to the systems staff. Once they get the message, they can create your Subversion server access account (which is separate from your other accounts and should, of course, use a different password.

Note that

  1. Your username will be the same as your username on the math cluster.
  2. Systems staff will never see your password, so if you forget it, you will need to create a new one.

If You Do Not Have a Math Account

If you don't have a math account, but you're working with a group that is using a Subversion repository hosted by the department, you can generate a password manually and send it to systems staff. You will need to be vouched for by the repository owner before being granted access to the repository, of course.

To generate a username and password in the correct format,

  1. Create a password for use with the Subversion server:
    • Log into a system that has the htpasswd command available (e.g., a Mac OS X system (in /usr/sbin/htpasswd) or a Linux system with the Apache web server installed).
    • Run htpasswd as
      htpasswd -c -m file username
      where file is an arbitrary file name and username is your desired username. (You may need to specify the path to the htpasswd program if it is not in your standard path.
  2. Send the entire contents of the file you created to the department's system administrator in an e-mail message that explains which repository you're requesting access to and who you're working with.

Checking Out a Working Copy from a Math Repository

Once the staff get back to you, you can check out the repository or subtrees with

svn co http://svn.math.hmc.edu/repository/subtree workdir

where repository is the name of your repository; subtree is the path to the project or subproject within your repository; and workdir is your local working directory.