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
- Go to your settings page
- Go to your SSH / GPG keys page
- Click Add key under SSH keys. Enter your name and then paste your public key.
- Hit Add key below.
3.5: (Optional but Recommended) Adding it to GitHub
- Go to Settings
- Go to SSH and GPG Keys
- 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.