Generating SSH Key Pairs on Linux

Generating SSH key pairs in Linux is a breeze. We'll walk you through the process in just a few simple steps.

  1. Start by opening up a new terminal window.

  2. Next, use the ssh-keygen command to start generating you key pair:

    ssh-keygen -t rsa
  3. You'll now be prompted with a series of questions.

    The first of these questions is where you would like to store your key. By default, it will be stored inside your user's .ssh directory as id_rsa. Unless you have an existing key there, the default location is fine.

  4. After selecting your key's location, you'll be asked to enter a passphrase for your key.

    Note: While it is possible to leave this field blank to generate a key without a passphrase, we recommend that you always set a passphrase on your SSH keys. Setting a passphrase ensures that someone cannot gain access to your key with just the private key file alone.

  5. Once your passphrase has been entered, your SSH key pair will be generated.

    To access your public key's contents, you can use the cat command like this:

    cat ~/.ssh/id_rsa.pub

Now that your key pair has been generated and you can access your public key file's contents, you're ready to add it to your Atomic account!