Generating a new SSH key and adding it to the ssh agent - giobim/Some-help-from-my-Friends GitHub Wiki

After you've checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent.

  1. Open a shell.
  2. Paste the text below, substituting in your short name in the email address.
$ ssh-keygen -t rsa -b 2048 -C "[email protected]"
# Creates a new ssh key, using the provided email as a label
Generating public/private rsa key pair.
  1. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
  1. At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

If you are under Windows and use putty, read how to Generating a SSH key on Windows.

Adding your SSH key to the ssh-agent

Before adding a new SSH key to the ssh-agent, you should have checked for existing SSH keys and generated a new SSH key.