# Generate SSH private-public key pair

## Linux / Windows / MAC

Open terminal and enter the following command, substituting in your GitHub email address.

```bash
$ ssh-keygen -t ed25519 -C "your_email@example.com"
```

> If you are using a legacy system that doesn't support the Ed25519 algorithm, use:

```bash
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```

You'll be asked to choose the file location, here you can choose a custom name as well. If want to keep default name and location simply press enter key.

```bash
> Enter a file in which to save the key (/c/Users/you/.ssh/custom_name):[Press enter]
```

Then you'll need to type in and confirm a password/passphrase to protect your ssh keys, if you wish you may just press enter for no password/passphrase.

> You will not see anything as you type, nonetheless, characters are still being captured so continue as normal.

```bash
> Enter passphrase (empty for no passphrase): 
> Enter same passphrase again: 
```

Now your SSH key pair is ready to go.

## Reference Links

* <https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-configure-GitLab-SSH-keys-for-secure-Git-connections>
