###1. Check for SSH keys.
If it says “No such file or directory“ skip to step 3. Otherwise continue to step 2.
###2. Backup and remove existing SSH keys.
Since there is already an SSH directory you’ll want to back the old one up and remove it:
$ lsLists all the subdirectories in the current directory
config id_rsa id_rsa.pub known_hosts
$ mkdir key_backupmakes a subdirectory called "key_backup" in the current directory
$ cp id_rsa* key_backupCopies the id_rsa and id_rsa.pub files into key_backup
$ rm id_rsa*
###3. Generate a new SSH key.
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
$ ssh-keygen -t rsa -C "firstname.lastname@example.org"
Creates a new ssh key using the provided email
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>
Now you need to enter a passphrase.
Enter passphrase (empty for no passphrase):<enter a passphrase>
Enter same passphrase again:<enter passphrase again>