SSH keys

SSH keys are necessary to login to the and  servers to push code to.

Generating a new SSH key
Follow the instructions below to create one if you do not already have one in. To make sure whether you need to generate a brand new key, let's check if an SSH key already exists on your system. Run this command in a terminal:

The command will list the files that are in the (hidden) directory. If the directory already exists on your system and if the output lists a file called, then you can go directly to #Copy your SSH Public key.

To generate a new SSH key, open a terminal then enter the command below and replace with your own email address. We want the default settings so when asked to enter a file in which to save the key, just press Enter.

Enter a strong and unique passphrase and press the Enter key.


 * Why do passphrases matter?


 * Passwords aren’t very secure. If you use one that’s easy to remember, it’s easier to guess or brute-force.  If you use one that’s random it’s hard to remember, so you might write the password down.  Both are very bad.  This is why you’re using ssh keys.  But using an ssh key without a passphrase is basically the same as writing down that random password in a file on your computer.  Anyone who gains access to your drive has gained access to every system you use that key with.  That's why you also add a passphrase.  To not enter a long passphrase every time you use the key, there’s a tool called  .  It can save your passphrase securely.  If you use macOS or Linux, then your keys can be saved in the system’s keychain to make your life even easier.

The command will create 2 files in  directory:


 * - your private SSH key (for identification)
 * - your public SSH key

Copy your SSH Public key
Get the content of your public key file (e.g. ) to copy it to your clipboard:

One option is to open your public key file with your favorite text editor (Notepad, TextEdit, gedit, etc.). In the file chooser dialog of your text editor, you may need to turn on “View hidden files” to find the file, because the directory is hidden. Sometimes the “View hidden files” option is available by right-clicking in the file chooser dialog.

Other options are:


 * On Linux, run and manually copy the output to the clipboard.
 * On Windows, you can open Git GUI, go to Help 🡒 Show Key, and then press "Copy To Clipboard" to copy your public key to your clipboard.
 * On macOS, you can run to copy the contents of the your public key file to your clipboard.

It’s important you copy your SSH Public key exactly as it is written, without adding any newlines or whitespace. Copy the full text, including the " ssh-ed25519 " prefix, the key itself, and the email address suffix.

Add SSH Private key to use with Git
Start the Git Bash command line.


 * Start the ssh-agent service
 * Be sure to use the accent, not the single quote  .  (You could copy and paste from this page if you cannot easily enter this special character.)  Note also that if you are using an alternative shell in Linux (for example the Fish shell), this command may not work; switching to Bash will fix the issue.
 * Be sure to use the accent, not the single quote  .  (You could copy and paste from this page if you cannot easily enter this special character.)  Note also that if you are using an alternative shell in Linux (for example the Fish shell), this command may not work; switching to Bash will fix the issue.


 * Add your private key to the agent. If you followed the steps above and your key has the default name , then the command is:
 * If you get, run  and then rerun the above command.
 * If you get, run  and then rerun the above command.

For macOS see [ https://medium.com/codex/git-authentication-on-macos-setting-up-ssh-to-connect-to-your-github-account-d7f5df029320 CodeX article].