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:
1
2
3
4
5
$ lsLists all the subdirectories inthe current directory
config id_rsa id_rsa.pub known_hosts
$ mkdir key_backupmakes a subdirectory called "key_backup"inthe current directory
$ cp id_rsa* key_backupCopies the id_rsa and id_rsa.pub filesinto 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.
1
2
3
4
$ ssh-keygen -t rsa -C "ldneedu@gmail.com"
Creates anew ssh key usingthe provided email
Generating public/private rsa key pair.
Enter filein which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>
Now you need to enter a passphrase.
1
2
Enter passphrase (empty for no passphrase):<enter a passphrase>
Enter same passphrase again:<enter passphrase again>