How to Connect to Github from HPC

Keren Xu

2020/08/19

Set up keys for SSH

This post has mentioned how to create public key and private key for the discovery cluster on hpc.

[christay@discovery .ssh]$ ssh-keygen -t rsa -b 2048 -f id_rsa_git
[christay@discovery .ssh]$ ls id_rsa_git*
id_rsa_git id_rsa_git.pub

Add the private key in the key pair to ~/.ssh/config

[christay@discovery work]$ cat ~/.ssh/config
# Added by Warewulf 2020-01-28
Host *
  IdentityFile ~/.ssh/cluster
  StrictHostKeyChecking=no
# Add below here -->
Host github.com
  HostName github.com
  IdentityFile ~/.ssh/id_rsa_git
  User <my Git username>

Add the public key in the key pair to Github

Detailed steps have been documented in jenny bryan happy git 11.5 Provide public key to GitHub

Now we are all set~
Try ssh -T git@github.com to test your connect to Github.

Set up a new repo

git init
git add
git commit

Create a empty repo on Github, then

git remote add origin git@github.com:username/new_repo
git push -u origin master