Creating SSH Keys on MacOS or Linux¶
The standard OpenSSH suite of tools contains the ssh-keygen
utility, which is used to generate key pairs. Run it on your local computer:
title='Terminal'
ssh-keygen
The utility prompts you to select a location for the keys. By default, the keys are stored in the `~/.ssh` directory with the filenames `id_rsa` for the private key and `id_rsa.pub` for the public key.
Using the default locations allows your SSH client to automatically find your SSH keys when authenticating, so we recommend accepting them by pressing `ENTER`.
!!! note "Important"
If you have previously generated a key pair, you may see a prompt that looks like this:
```
/home/username/.ssh/id_rsa already exists.
Overwrite (y/n)?
```
If you choose to overwrite the key on disk, you will not be able to authenticate using the previous key anymore. Selecting yes is an irreversible destructive process.
### Password
Once you select a location for the key, you'll be prompted to enter an optional passphrase which encrypts the private key file on disk.
If you enter one, you will have to provide it **every time** you use this key unless you are running **SSH agent** software that stores the decrypted key.
We recommend using a passphrase, but you can press `ENTER` to bypass this prompt.