Accessing CSIL Git Servers

 

The CSIL Git server will become

READ ONLY

from DECEMBER 19th, 2023

 

THE CSIL Git server will be

DECOMISSIONED

February 15th, 2024

 

 

SFU now runs an Enterprise Github server at github.sfu.ca. All SFU users are encouraged to transition to this new powerful server.


csil-git1.cs.surrey.sfu.ca will no longer accept new users as of December 6th 2023 and will no longer allow users to update files as of December 19, 2023.


The CSIL Git server will be shut down entirely February 15th 2024.


Please move your content to the new SFU github server.


Note: cs-git-research.cs.surrey.sfu.ca will continue for the time being.

 


Accessing our git servers from outside of SFU wired network requires some additional steps. These are explained here. You will need to follow these procedures when you want to connect from your laptop or from your home computer.

Please note that we are unable to provide any direct support for trouble shooting non-CS systems.

There are generally two methods you can use to work with the git server.

  1. HTTPS method
  2. SSH method with SFU VPN
  3. SSH method with CSIL SSH Gateway

1. Using HTTPS method

This method works the same way whether you are on Campus (i.e., logged on to a computer on SFU network) or not. Simply use the repository path that uses 'https' when cloning. This path can be found by clicking on the 'Clone' button on the git server repository page.

    git clone https_repository_path

where https_repository_path would look something like: https://csil-git1.cs.surrey.sfu.ca/username/reponame.git.

This will ask for your username and password. Once correct values entered, it will clone the repo to your local system. When you subsequently push or pull changes, it will normally ask for username/password again.

Making it easier

You can avoid having to enter username and password everytime by using 'credential helpers'. The 'cache' helper can be set up by entering:

   git config --global credential.helper cache

This will keep and use your credentials for 15 minutes, by default.

You can also use various other credential helpers available on the specific OS of your system which will not have such time limitation. Search google for examples.

2. Using SSH Method with SFU VPN

When you are connected to SFU VPN, you can directly work with CSIL Git server.

 

 

3. Using SSH Method with CSIL SSH Gateway

This is more complicated to set up as the Campus firewall doesn't allow direct ssh access to the git server - you need to go through CSIL Gateway (gateway.csil.sfu.ca).

You will use SSH local forward feature to get this working.

Prerequisites

  • You have access to an SSH client (For Windows: MobaXTerm, Windows Power Shell, WSL or PuTTY; For Mac: Terminal, XQuartz; for Linux: Terminal)
  • You have generated a ssh key pair on your local system and added the public key to your gitlab account
  • You are able to login to gateway.csil.sfu.ca server successfully (by using your SFU password and MFA/OTP)

Which ever terminal type you use, you will have your '.ssh' directory that contains your SSH key pair, usually called 'id_rsa' and 'id_rsa.pub', the former being the 'private key' and the latter the corresponding ''public key'. You will need the path of the private key file.

1. Set up your ssh config file

In your '.ssh' directory, create a file called 'config', and add the following content:

Host gateway.csil.sfu.ca
  User your_user_id
  Port 24
  LocalForward 12021 csil-git1.cs.surrey.sfu.ca:22

Host csil-git1.cs.surrey.sfu.ca
  HostName 127.0.0.1
  Port 12021
  User git
  IdentityFile path_to_your_private_key

Replace your_user_id with your actual SFU ID and path_to_your_private_key with the actual path. (Examples: c:\users\USERNAMEONYOURCOMPUTER\.ssh\id_rsa, ~/.ssh/id_rsa, etc.).

2. Set up SSH Local Forward

Run the following command in a terminal on your local computer. (If you are using MobaXTerm, make sure you use an 'SSH session' instead of a 'Local session' in this step.)  

  ssh gateway.csil.sfu.ca

Taking the instructions from the first part of your ssh config file in step 1 above, you are now logged in to gateway.csil.sfu.ca on port 24 AND local forwarding is set up so that all traffic you send to port 12021 of your local computer is forwarded to csil-git1 on port 22.  

Command will prompt for your password and the OTP. After that you will be logged on to gateway.csil.sfu.ca.

Leave this connection running while you are working and connecting to csil-git1 (mostly push/pull/clone).

3. Use git Commands

Open another terminal/tab and use git as you would normally use it:

  git clone git@csil-git1.cs.surrey.sfu.ca:youruserid/cmpt127-1207-youruserid.git

The second part of your ssh config (step 1) now ensures that connections to csil-git1.cs.surrey.sfu.ca are actually connections to the localhost on port 12021 - which are forwarded to csil-git1 on port 22 as per the set up in step 2 above.

From here on, you can modify files, run git push, pull commands and they would work just like when you are on a CSIL host.

If you are using any other tool to access git, you may have to specify that the git server is on port 12021 on 127.0.0.1.

4. End your SSH session

Remember we set up local forwarding in one terminal and had it running all this time? Once you have finished using git, you should end that session (otherwise, it will be automatically ended after some idle time).

Making it easier

(This will describe how to use ssh key to login to gateway by only entering OTP. This option is not available as yet.)


Last updated: @ 2023.09.26