You can access repositories at this site via SSH if you prefer.

This feature only works with key-based authentication. To use it, you need to generate a key pair, use one of the keys as your private identity in your Subversion client, and upload the other (public) key here so this site can veryify your identity.

When this is done, you should be able to access a given repository repo with an address such as:

svn+ssh://svn@scc-forge.lancaster.ac.uk/repo/
git://git@scc-forge.lancaster.ac.uk/repo

Server fingerprint

When you first connect to the server, your SSH client should report the following fingerprint:

33:65:24:a1:e1:b7:e6:8a:9d:00:5e:1a:7a:62:0d:9f

This was last changed on 2011-12-02.

Switching working copies

If you want to use SSH on an existing Subversion working copy currently using HTTPS, you can switch it with this command:

svn switch --relocate \
     https://scc-forge.lancaster.ac.uk/svn-repos/ \
     svn+ssh://svn@scc-forge.lancaster.ac.uk/

For Git, you will need to change a remote, probably origin:

git remote set-url origin \
     git://git@scc-forge.lancaster.ac.uk/repo

Uploading a key

Two formats are acceptable:

  • OpenSSH, which looks like this:
    ssh-dss XXXXXXXXXXXX comment
    
  • SSH2, which looks like this:
    ---- BEGIN SSH2 PUBLIC KEY ----
    Comment: "some comment" 
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    ---- END SSH2 PUBLIC KEY ----
    

If you have your key ready, you can submit it S.

Creating and using keys

If you're already using a key pair with SSH, you can use it for this site too, and don't need to create a new one. Just upload the correct public key in the right format.

Otherwise, you'll need to create a key pair, set your SSH client to use the private key, and send the public key here.

OpenSSH on Unix systems

OpenSSH stores its configuration in ~/.ssh/. Look for a file there with one of these default names:

  • id_ecdsa
  • id_dsa
  • id_rsa
  • identity

It should contain a private key, and you should find the corresponding public key in a file with the same name plus the .pub suffix. It's possible to use other filenames, or even different keys per host, by placing an Identity directive in the file config, so check for that too.

If you can't find an existing key pair, create one with the following command (or similar):

ssh-keygen -t ecdsa

That will create a key pair under the default filenames id_ecdsa and id_ecdsa.pub. Upload S id_ecdsa.pub.

Check that you have access with the following command:

ssh svn@scc-forge.lancaster.ac.uk -o PreferredAuthentications=publickey

(Even if you're using Git, the same key is set up for Subversion too.) You'll get a strange prompt if everything is working. Otherwise, it will fail immediately.

See the ssh-keygen manual page for further details.

Using svn:externals

Under SVN, it's possible to apply an svn:externals property to a folder, so that external repositories will get checked out along with that folder. For example, this checks out four subtrees of other repositories into the libs subfolder of the working copy of the folder it is applied to:

https://scc-forge.lancaster.ac.uk/svn-repos/repo1/pkg1/trunk libs/pkg1
https://scc-forge.lancaster.ac.uk/svn-repos/repo1/pkg2/trunk libs/pkg2
https://scc-forge.lancaster.ac.uk/svn-repos/repo2/pkg3/trunk libs/pkg3
https://scc-forge.lancaster.ac.uk/svn-repos/repo2/pkg4/trunk libs/pkg4

If you check out this folder using SSH, the externals will still be checked out via HTTP, which might defeat the purpose of switching to SSH. For lines that refer to other folders at this site, you can use relative paths with the latest versions of Subversion:

^/../repo1/pkg1/trunk libs/pkg1
^/../repo1/pkg2/trunk libs/pkg2
^/pkg3/trunk libs/pkg3
^/pkg4/trunk libs/pkg4

(This assumes that pkg3 and pkg4 are in the same repository, and pkg1 and pkg2 are in a different repository on the same site.)

Now the externals will be checked out using the same protocol as used for the affected folder itself.

Related pages


Lancaster University
© School of Computing and Communications, Lancaster University – Disclaimer & copyright
Some images from PixelMixer