Using GitHub on the cluster
Please don’t run git on the head node, rather use an interactive job.
All worker nodes access the internet through a proxy. This is fine for normal GitHub repos, however accessing private repos is a bit more challenging. You will need to generate an ssh key and store this in your GitHub account, then setup a ssh config file.
Create an ssh key. It is recommended you use an ed25519 key:
ssh-keygen -t ed25519 -C "MyEmail@Address"
This will create an id_ed25519 keypair in your .ssh folder.
Also in your .ssh folder create a config file. The contents of the file should be:
Host github.com Hostname ssh.github.com Port 443 User git IdentityFile ~/.ssh/id_ed25519 ProxyCommand ncat --proxy-type http --proxy 10.105.1.2:8000 %h %p
Now login to GitHub. In the upper-right corner of any page on GitHub, click your profile picture, then click Settings.
- In the “Access” section of the sidebar, click SSH and GPG keys.
- Click New SSH key or Add SSH key.
- In the “Title” field, add a descriptive label for the new key. For example “UCTHPC”.
- Select authentication key.
- In the “Key” field, paste your public key. This is the contents of ~/.ssh/id_ed25519.pub
- Click Add SSH key.
- You may need to verify the key addition with 2FA.
Now you can:
git clone git@github.com:SomeGitHubAccount/somerepo.git
