Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


title: SSH Setup

This will probably take only about 3-5 minutes.

1: Registering a git.cmu.dev account

Head to https://git.cmu.dev/ and register an account by signin in with your Andrew ID email through the CMU login.

Follow their registration process until you get signed in.

2: Generate an SSH key

Open up a terminal and enter this command:

ssh-keygen -t ed25519 -C "<email>"

Where <email> is the same email you used to register your account on git.cmu.dev and have in GitHub.

It will prompt you to set the location of a file. Leave it blank (press Enter) to use the default path. The rest of this guide assumes you left this blank.

Set a password for the file – do not leave it blank like the location.

If you forgot to set a password, add one with:

ssh-keygen -p -f ~/.ssh/id_ed25519

Now display your public key:

cat ~/.ssh/id_ed25519.pub
# Should look like: ssh-ed25519 <SOME HASH> <YOUR EMAIL>

Copy what it prints in the terminal.

3: Adding it to git.cmu.dev

  1. Go to your settings page
  2. Go to your SSH / GPG keys page
  3. Click Add key under SSH keys. Enter your name and then paste your public key.
  4. Hit Add key below.
  1. Go to Settings
  2. Go to SSH and GPG Keys
  3. Click Add SSH Key. Enter a name and paste your public key.

Make one copy as a Signing Key, and another copy of the same public key as an Authentication Key.

3.6: Adding to Command Line Git

Run these in terminal:

eval "$(ssh-agent -s)"
# Should show "Agent pid <some numbers>"
# If not, restart your terminal.
# This is just a check that your agent is running.

ssh-add ~/.ssh/id_ed25519

If you’re working with Forgejo, you’re done!

4: (Optional) Testing if it worked for GitHub

# If you did steps 3.5 and 3.6:
ssh -T git@github.com
# Should show: "Hi <username>! You've successfully authenticated, but GitHub does not provide shell access."
# Let a devops member know if this returns some variation of "permission denied".

The output should be something like Hi <USERNAME>! You've successfully authenticated, but <GitHub/Forgejo> does not provide shell access.