Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creating a SSH key and adding to agent.
  1. Open terminal.
  2. Enter the command below, replacing with your email:
$ ssh-keygen -t rsa -b 4096 -C "" -f <path to key>

The path to key should be in ~/.ssh directory, with a self-explanatory filename and no spaces.

  1. Type a password...
  • Having a password is recommended if you're using the key to log into a server;
  • Don't use a password if the key is for automatic server deploys or other automated tasks;
  1. Save the key by pressing enter.
  2. Add ssh key to agent:
$ ssh-add <path to key>
  1. Enter password if you used one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment