---
# System prepended metadata

title: Setting up SSH keys for Github

---

<style>
    .markdown-body h1:first-of-type {
        margin-top: 24px;
    }
    .markdown-body h1 {
        margin-top: 64px;
    }
    .markdown-body h1 + h2 {
        margin-top: 32px;
    }
    .markdown-body h2 {
        margin-top: 48px;
    }
    .markdown-body h2.topics {
        font-size: 1.8em;
        border-bottom: none;
    }
    .markdown-body h2 {
        color: #5a57b8;
    }
    .markdown-body h3 {
        color: cornflowerblue;
    }
    .markdown-body h4 {
        color: cornflowerblue;
    }
    .exercise {
        font-size: 150%;
        font-weight: bold;
        color: rgb(227,112,183);
    }
    .note {
        color: red;
    }
    .markdown-body em {
        color: #e000e0;
    }
    .markdown-body strong {
        color: #e000e0;
        font-weight: bold;
    }
    .markdown-body p a,
    .markdown-body td a {
        border-bottom: 1px solid;
    }
    .markdown-body a:hover {
        border-bottom: none;
        text-decoration: none;
    }
</style>

# Setting up SSH keys for Github

The final step in setting up your development environment (e.g. Ubuntu in WSL) and workflow (cloning assignments from Github and pushing changes) is creating an SSH key and associating it with your Github account.

SSH keys are a more secure and convenient (no more entering your password every time you push a commit!) way to authenticate yourself when cloning from or pushing to a repository on Github.

To create an SSH key, being by running the following command (substituting your actual email for 'you@bcit.ca') in the terminal:

```shell
ssh-keygen -t ed25519 -C "you@bcit.ca" -f ~/.ssh/acit1515
```

Skip (i.e. do not enter) the optional passphrase twice until you see confirmation that your key has been saved.

You next need to tell the SSH agent (the program that manages your ssh keys) that a new key has been created. Run the following command:

```shell
ssh-add ~/.ssh/acit1515
```

If you see an error message related to being unable to find the ssh agent, you can run the following command:

```shell
eval $(ssh-agent -s)
```

and then repeat the ssh-add command above.

Finally, you must associate the key you created with your Github account. Instructions on how to do that are located here: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

Assuming no other errors have occurred, you should now be able to clone and push to and from your Github repositories without having to enter a password. If you do encounter errors please ask your instructor for assistance.