Generate a new key
If you don’t have an existing SSH key that you wish to use, generate one as follows:
-
Open a terminal on your local computer and enter the following:
ssh-keygen -t ed25519 -C "your_email@example.com"
Associating the key with your email address helps you to identify the key later on.
You’ll see a response similar to this:
chaiss@C02FP1JWMD6V ~ % ssh-keygen -t ed25519 -C chaiss@email.com Generating public/private ed25519 key pair. Enter file in which to save the key (/Users/chaiss/.ssh/id_ed25519):
- Just press <Enter> to accept the default location and file name. If the
.ssh
directory doesn’t exist, the system creates one for you. -
Enter, and re-enter, a passphrase when prompted.
The whole interaction will look similar to this:chaiss@C02FP1JWMD6V ~ % ssh-keygen -t ed25519 -C chaiss@email.com Enter file in which to save the key (/Users/chaiss/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: