-
Notifications
You must be signed in to change notification settings - Fork 0
Setting Up Your GitHub SSH Keys
We use SSH to connect to GitHub. Please ask one of the Autonomy Team Leads if you do not have access to the all_seaing_vehicle repository.
If you are on Windows and the commands do not work, follow this tutorial.
Before generating a new SSH key, first check if you have one already.
Type the following into your terminal to see all the files in your ~/.ssh
directory.
ls -a ~/.ssh
If you get an error saying that the .ssh
directory doesn't exist, then this means you do not have any SSH keys yet, so go to step 2.
Otherwise, check if there are any keys with any of these types.
id_rsa.pub
id_ecdsa.pub
-
id_ed25519.pub
If so, go to step 3.
To generate a new SSH key, paste this into your terminal, replacing the email with your email connected to your GitHub.
ssh-keygen -t ed25519 -C "[email protected]"
When it asks you to "Enter a file in which to save the key," just press enter (the key will be saved in the default location).
It'll also let you add a passcode for your SSH key, but we recommend you just press enter and to not use a passcode (it will be more convenient later).
Start your SSH agent using the following
eval "$(ssh-agent -s)"
If this doesn't work, you might need to use root access using sudo -s -H
, then starting the SSH agent again. If these don't work, you can also try to run exec ssh-agent bash
or exec ssh-agent zsh
.
Add your key to your SSH agent using
ssh-add ~/.ssh/id_ed25519
Paste in the following to get your SSH key.
cat ~/.ssh/id_ed25519.pub
Copy the results, and make sure not to add new lines or whitespace.
Once you have the SSH key, go to github.com. Click on your profile in the top right corner, then go to settings.
Go to the section called SSH and GPG keys and click New SSH key or Add SSH key.
Put a descriptive label in the "Title" field, and paste your key in the "Key" field. Click Add SSH key once done.
This page is based off of Generating a New SSH Key and Adding a New SSH Key by GitHub.
Top: Installation | Next: Native Installation or Docker Installation |
---|